-
Notifications
You must be signed in to change notification settings - Fork 494
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
[Internal] Query: Adds Query Advice Request and Response capabilities #4714
base: master
Are you sure you want to change the base?
Conversation
…thub.com/Azure/azure-cosmos-dotnet-v3 into users/leminh/QueryAdvisorRequestResponse
@@ -433,6 +435,8 @@ public ChangeFeedEstimatorEmptyFeedResponse(ITrace trace) | |||
|
|||
public override string IndexMetrics => string.Empty; | |||
|
|||
public override string QueryAdvice => string.Empty; |
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.
/// </summary> | ||
/// <value> | ||
/// The index utilization metrics. | ||
/// </value> |
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.
please fix the comment
sealed class QueryAdvice | ||
{ | ||
[JsonConstructor] | ||
public QueryAdvice(IReadOnlyList<SingleQueryAdvice> queryAdvices) |
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.
sealed class QueryAdvice | ||
{ | ||
[JsonConstructor] | ||
public QueryAdvice(IReadOnlyList<SingleQueryAdvice> queryAdvices) |
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.
} | ||
} | ||
|
||
public static string ToString(QueryAdvice advice) |
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.
override ToString rather than static function
return String.Empty; | ||
} | ||
|
||
string result = String.Empty; |
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.
StringBuilder
} | ||
} | ||
} | ||
} |
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.
override ToString instead of static function
Pull Request Template
Description
This PR adds the capability to request and receive Query Advice in QueryRequests. The response from BE is an URL-encoded JSON string that will get decoded to UTF8 text.
To request query advice, use the new
QueryRequestOpton.PopulateQueryAdvice
Once this is set to true, see the advice via
FeedResponse.QueryAdvice
propertyNote: the test is marked Ignore because the emulator used in pipeline does not support Query Advisor yet. Furthermore, this request option is internal and not yet public to wait for the deployment
Type of change
Please delete options that are not relevant.
Closing issues
To automatically close an issue: closes #IssueNumber