Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query : Fix Multi- ORDER BY continuation token support with QueryExecutionInfo Response headers #1585

Merged
merged 2 commits into from
Jun 11, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
added switch on disable reverse rid
  • Loading branch information
bchong95 committed Jun 2, 2020
commit c242442a18a6873c5a4f03437e6a95eea03b45ac
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,19 @@ private async Task<TryCatch> TryFilterAsync(
cmp = continuationRid.Document.CompareTo(rid.Document);
if (producer.CosmosQueryExecutionInfo.ReverseRidEnabled)
{
cmp = -cmp;
// If reverse rid is enabled on the backend then fallback to the old way of doing it.
if (sortOrders[0] == SortOrder.Descending)
{
cmp = -cmp;
}
}
else
{
// Go by the whatever order the index wants
if (producer.CosmosQueryExecutionInfo.ReverseIndexScan)
{
cmp = -cmp;
}
}

// We might have passed the item due to deletions and filters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@ public CosmosQueryExecutionInfo(bool reverseRidEnabled, bool reverseIndexScan)
this.ReverseIndexScan = reverseIndexScan;
}

/// <summary>
/// Whether or not the backend has the reverseRid feature enabled.
/// </summary>
[JsonProperty("reverseRidEnabled")]
public bool ReverseRidEnabled { get; }
bchong95 marked this conversation as resolved.
Show resolved Hide resolved

/// <summary>
/// Indicates the direction of the index scan.
/// </summary>
[JsonProperty("reverseIndexScan")]
public bool ReverseIndexScan { get; }
}
Expand Down