-
Notifications
You must be signed in to change notification settings - Fork 501
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
TryExecuteQuery #837
TryExecuteQuery #837
Conversation
Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not an SDK concern and needs to be part of friends.
@bchong95 won;t it get solved by query wire protocol versioning and configuring SDK to use target version? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bchong95 wont it get solved by query wire protocol versioning and configuring SDK to use target version?
There isn't any versioning or configuring here |
This is merely exposing a TryExecute variant of CreateDocumentQuery. They are calling into the same version of code. |
Is 'TryExecuteQuery' purely an optimization to avoid NotSupported exception? |
It also allows the caller to determine what queries they want to allow. |
@bchong95 please refresh the description also with current state of PR. |
* allowed for retrieval of query plan without exception * wired query plan through the stack * wired a try execute function * added test * resolved iteration comments * removed contracts * added GROUP BY support * resolved iteration comments * added try execute query * added back methods that require private members
TryExecuteQuery
Description
This PR adds support for a TryExecuteQuery method which will try to execute a query with a set of supported query features. If the query is supported than the method will return a QueryIterator. If the query is not supported than the method returns a QueryPlan instead.
The purpose of this method is to support SQL Query Compute Gateway. We are going to initially only support queries that don't require any distribution work and over time allow more queries. If the query is not supported than we will send back a bad request with the query plan as usual and allow the SDK to do the cross partition work. The method will also always return a QueryPlan even if the query is executable, since we might want to cache the query plan in the future.
Type of change
Please delete options that are not relevant.