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

feat: support PPL in vega visualization #7285

Merged

Conversation

ruanyl
Copy link
Member

@ruanyl ruanyl commented Jul 17, 2024

This commit add PPL support in Vega visualization, it rely on query enhancement plugin to support search with PPL

Vega visualization UI changes is out of the scope of this PR, will add UI changes in separate commits

Description

image

Issues Resolved

Screenshot

Testing the changes

Changelog

  • feat: support PPL in vega visualization

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

This commit add PPL support in Vega visualization, it rely on query
enhancement plugin to search with PPL

Vega visualization UI changes is out of the scope, will add UI changes
in separate commits

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Copy link
Contributor

❌ Empty Changelog Section

The Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section.

Copy link
Contributor

❌ Empty Changelog Section

The Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section.

2 similar comments
Copy link
Contributor

❌ Empty Changelog Section

The Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section.

Copy link
Contributor

❌ Empty Changelog Section

The Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section.

Copy link

codecov bot commented Jul 17, 2024

Codecov Report

Attention: Patch coverage is 64.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 67.53%. Comparing base (5741fd7) to head (e8f0e3b).
Report is 23 commits behind head on main.

Files Patch % Lines
...gins/vis_type_vega/public/data_model/search_api.ts 12.50% 7 Missing ⚠️
...gins/vis_type_vega/public/data_model/ppl_parser.ts 85.71% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7285   +/-   ##
=======================================
  Coverage   67.53%   67.53%           
=======================================
  Files        3504     3505    +1     
  Lines       69407    69427   +20     
  Branches    11324    11328    +4     
=======================================
+ Hits        46872    46886   +14     
- Misses      19775    19779    +4     
- Partials     2760     2762    +2     
Flag Coverage Δ
Linux_1 33.16% <60.00%> (+0.01%) ⬆️
Linux_2 55.46% <0.00%> (ø)
Linux_3 43.05% <33.33%> (ø)
Linux_4 34.76% <0.00%> (ø)
Windows_1 33.18% <60.00%> (+0.01%) ⬆️
Windows_2 55.41% <0.00%> (ø)
Windows_3 43.06% <33.33%> (ø)
Windows_4 34.77% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
@@ -62,7 +62,7 @@ export function registerSearchRoute(
try {
const { withLongNumeralsSupport, ...response } = await selfStart.search.search(
context,
{ ...searchRequest, id },
{ ...searchRequest, id, rawRequest: request },
Copy link
Member

Choose a reason for hiding this comment

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

i wouldn't update this. when it's ppl, the whole request should be passed as long as you just send it

Copy link
Member Author

Choose a reason for hiding this comment

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

You mean we check the strategy here, and when it's ppl, we send the whole request instead of request.body?

Copy link
Member Author

@ruanyl ruanyl Jul 19, 2024

Choose a reason for hiding this comment

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

The client.asScoped(request) we call in search strategy requires the http request object, currently I see no better way to get it unless pass it explicitly.

SuZhou-Joe
SuZhou-Joe previously approved these changes Jul 18, 2024
SuZhou-Joe
SuZhou-Joe previously approved these changes Jul 18, 2024
Copy link
Member

Choose a reason for hiding this comment

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

would it be possible to put like a parsers map in the search service? ideally. all non-out of the box experience is encapsulated within the query enhancements. so the parsers service can host the parser and take in a search strategy id. then in query enhancements we register the ppl

avoids having to re-write shared logic too

Copy link
Member Author

@ruanyl ruanyl Jul 23, 2024

Choose a reason for hiding this comment

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

Agree, let's explore the reusability, especially with considering the vis builder+vega, but that requires to clarify the requirement from both technical and design perspective, I'll leave it for future iteration, this PR is just the first step to add ppl support in vega. For now, I'll keep the scope as small as possible :)

@ruanyl ruanyl merged commit 0af4b04 into opensearch-project:main Jul 23, 2024
69 of 71 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 23, 2024
* feat: support PPL in vega visualization

This commit add PPL support in Vega visualization, it rely on query
enhancement plugin to search with PPL

Vega visualization UI changes is out of the scope, will add UI changes
in separate commits

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>

---------

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 0af4b04)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.16 failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.16 2.16
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.16
# Create a new branch
git switch --create backport/backport-7285-to-2.16
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 0af4b04cd2f1ab90207eb84a91d96088231a4664
# Push it to GitHub
git push --set-upstream origin backport/backport-7285-to-2.16
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.16

Then, create a pull request where the base branch is 2.16 and the compare/head branch is backport/backport-7285-to-2.16.

ruanyl pushed a commit that referenced this pull request Jul 23, 2024
* feat: support PPL in vega visualization

This commit add PPL support in Vega visualization, it rely on query
enhancement plugin to search with PPL

Vega visualization UI changes is out of the scope, will add UI changes
in separate commits



---------



(cherry picked from commit 0af4b04)

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 23, 2024
* feat: support PPL in vega visualization

This commit add PPL support in Vega visualization, it rely on query
enhancement plugin to search with PPL

Vega visualization UI changes is out of the scope, will add UI changes
in separate commits

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>

---------

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 0af4b04)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ruanyl pushed a commit that referenced this pull request Jul 23, 2024
* feat: support PPL in vega visualization

This commit add PPL support in Vega visualization, it rely on query
enhancement plugin to search with PPL

Vega visualization UI changes is out of the scope, will add UI changes
in separate commits



---------



(cherry picked from commit 0af4b04)

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants