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

Discover Bug Fixes #7948

Merged
merged 2 commits into from
Sep 3, 2024
Merged

Conversation

LDrago27
Copy link
Collaborator

@LDrago27 LDrago27 commented Aug 30, 2024

Description

This changes fixes the following bugs

  • SQL Search not working for IndexPatterns with Wildcards in the name
  • Intial Page Load was not working for Non DQL default language

Issues Resolved

Screenshot

Meeting.Recording.-.Sahoo.Suchit.Instant.Meeting.6.mp4

Testing the changes

Changelog

  • skip

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

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.

@github-actions github-actions bot added the Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry label Aug 30, 2024
Copy link

codecov bot commented Aug 30, 2024

Codecov Report

Attention: Patch coverage is 45.45455% with 6 lines in your changes missing coverage. Please review.

Project coverage is 60.97%. Comparing base (0245540) to head (a8cb534).
Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
.../public/query/query_string/query_string_manager.ts 45.45% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7948      +/-   ##
==========================================
- Coverage   60.97%   60.97%   -0.01%     
==========================================
  Files        3684     3684              
  Lines       87038    87047       +9     
  Branches    13376    13378       +2     
==========================================
+ Hits        53074    53078       +4     
- Misses      30750    30754       +4     
- Partials     3214     3215       +1     
Flag Coverage Δ
Linux_1 29.26% <0.00%> (-0.01%) ⬇️
Linux_2 56.19% <ø> (ø)
Linux_3 37.82% <45.45%> (+<0.01%) ⬆️
Linux_4 29.56% <0.00%> (-0.01%) ⬇️
Windows_1 29.28% <0.00%> (-0.01%) ⬇️
Windows_2 56.14% <ø> (ø)
Windows_3 37.83% <45.45%> (+<0.01%) ⬆️
Windows_4 29.56% <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.

@LDrago27 LDrago27 force-pushed the initalPageLoadFix branch 3 times, most recently from 47331f8 to 75f5bed Compare August 31, 2024 00:31
Signed-off-by: Suchit Sahoo <suchsah@amazon.com>
Signed-off-by: Suchit Sahoo <suchsah@amazon.com>
Copy link
Member

@sejli sejli left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for helping to fix these bugs!

@@ -40,7 +40,7 @@ export class Facet {
const query: Query = request.body.query;
const { format, df } = request.body;
const params = {
body: { ...query },
body: { query: query.query },
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason why we removed the rest of the query object? I don't remember if the fetch() function for PPL and SQL use the rest of the object off the top of my head.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Before this change the request body that we used to send was of the following format

{
    query: {
      query: 'SELECT * FROM aaa* LIMIT 10',
      language: 'SQL',
      dataset: [Object],
      format: 'jdbc'
    },
    aggConfig: null,
    df: null
}

However the SQL plugins request only needs the following parameters.
image

Also we observed sending in the extra unrecognized parameters was causing bugs where the SQL Search not working for IndexPatterns with Wildcards in the name, therefore this PR aims to cleanup the request body that we send.

Copy link
Member

Choose a reason for hiding this comment

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

@abbyhu2000 abbyhu2000 merged commit c7843fe into opensearch-project:main Sep 3, 2024
66 of 67 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 3, 2024
* Fixed SQL search for Wildcard IndexPattern

Signed-off-by: Suchit Sahoo <suchsah@amazon.com>

* Fix Discover intial pageload for non DQL language

Signed-off-by: Suchit Sahoo <suchsah@amazon.com>

---------

Signed-off-by: Suchit Sahoo <suchsah@amazon.com>
(cherry picked from commit c7843fe)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
LDrago27 pushed a commit that referenced this pull request Sep 3, 2024
* Fixed SQL search for Wildcard IndexPattern

* Fix Discover intial pageload for non DQL language
---------
(cherry picked from commit c7843fe)

Signed-off-by: Suchit Sahoo <suchsah@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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x discover for discover reinvent seasoned-contributor Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry v2.17.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants