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

[Internal] Query: Adds Query Advice Request and Response capabilities #4714

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

leminh98
Copy link
Contributor

@leminh98 leminh98 commented Sep 23, 2024

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 property

Note: 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.

  • [] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [] This change requires a documentation update

Closing issues

To automatically close an issue: closes #IssueNumber

@leminh98 leminh98 marked this pull request as ready for review October 28, 2024 10:46
@leminh98 leminh98 changed the title Query: Adds Query Advice Request and Response capabilities [Internal] Query: Adds Query Advice Request and Response capabilities Oct 28, 2024
@@ -433,6 +435,8 @@ public ChangeFeedEstimatorEmptyFeedResponse(ITrace trace)

public override string IndexMetrics => string.Empty;

public override string QueryAdvice => string.Empty;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string.Empty

null?

/// </summary>
/// <value>
/// The index utilization metrics.
/// </value>
Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

queryAdvices

We need to change this name

sealed class QueryAdvice
{
[JsonConstructor]
public QueryAdvice(IReadOnlyList<SingleQueryAdvice> queryAdvices)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SingleQueryAdvice

We need to figure out how to call a single entity within the query advice

}
}

public static string ToString(QueryAdvice advice)
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StringBuilder

}
}
}
}
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants