[Cosmos][VectorSearch] Non Streaming Order By Query#39897
Merged
kushagraThapar merged 46 commits intoMay 20, 2024
Conversation
…ngPolicy (Azure#40004) * Adding changes for vectorIndex and vectorEmbeddingPolicy * Adding some necessary comments * Adding test case * updating enum values * Updating test case * Updating test case * Updating test case * updating changelog * Updating test case * Resolving comments * Resolving comments * Fixing test case * Resolving comments * Resolving Comments * Fixing build issues * Resolving comments * Resolving Comments
Collaborator
|
API change check APIView has identified API level changes in this PR and created following API reviews. |
xinlian12
reviewed
May 17, 2024
Member
Author
|
/azp run java - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run java - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run java - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run java - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run java - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run java - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
|
/check-enforcer override |
Query and service team has decided to go ahead with the opt-out env variable vector search feature, need to release today.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Java follow up to the .Net PR: Azure/azure-cosmos-dotnet-v3#4362
nonStreamingOrderBythat is now present in the query plan, we choose to create a separate query execution context for these types of operations.NonStreamingOrderByQueryQueryContext, essential for vector search capabilities. Previously, the SDK operated under the assumption that documents returned in response to ORDER BY queries were fully ordered across all continuations. However, with the newly implemented non-streaming OrderBy feature in the backend, this assumption is no longer valid.TOP +1orLIMIT+OFFSET+1for every document producer. This query pipeline functions as a blocking pipeline, similar to the GROUP BY. We will accumulate all the backend responses for every document producer in it's own PQ which is ordered using the comparator passed by the BE. Once all the document producers are processed, the are re-balanced together to yield the results.TOP +1orLIMIT+OFFSET+1, because once the PQ has reached the TOP size, we want to add one document, and then remove based on the ordering. If we just usedTOPorLIMIT+OFFSET, adding a new document after reaching the limit would make the PQ 50% bigger, which could mess up the results.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines