Skip to content

Commit

Permalink
Comments fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackGad committed Jul 13, 2024
1 parent 3bb279b commit 4d71943
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Milvus.Client/MilvusCollection.Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -567,13 +567,16 @@ public async IAsyncEnumerable<IReadOnlyList<FieldData>> QueryWithIteratorAsync(
Value = Math.Min(batchSize, leftItemsCount).ToString(CultureInfo.InvariantCulture)
});

string nextExpression = pkField.DataType == DataType.VarChar
? $"{pkField.Name} > '{pkLastValue}'"
: $"{pkField.Name} > {pkLastValue}";
string nextExpression = pkField.DataType switch
{
DataType.VarChar => $"{pkField.Name} > '{pkLastValue}'",
DataType.Int8 or DataType.Int16 or DataType.Int32 or DataType.Int64 => $"{pkField.Name} > '{pkLastValue}'",
_ => throw new MilvusException("Unsupported data type for primary key field")
};

if (!string.IsNullOrWhiteSpace(userExpression))
{
nextExpression += $" and {userExpression}";
nextExpression += $" and ({userExpression})";
}

request.Expr = nextExpression;
Expand Down

0 comments on commit 4d71943

Please sign in to comment.