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] undefined datasource fix for index patterns for PPL and SQL #8027

Merged

Conversation

kavilla
Copy link
Member

@kavilla kavilla commented Sep 5, 2024

Description

Deconstructing the dataSource caused an exception when no dataSource was set with the query. This can be the case with index patterns that are created and pointed to the default. Most times the default is the local cluster so there is no data source object in the query the case of the local.

Accessing by dot notation with null operator fixes this issue. Adding tests to prevent this happening again.

With query enhancements enabled we should considered ensuring index patterns always have a datasource object in the query.

Issues Resolved

Index patterns failed on SQL and PPL

Screenshot

URL:

query:(dataset:(id:d3d7af60-4c81-11e8-b3d7-01146121b73d,timeFieldName:timestamp,title:opensearch_dashboards_sample_data_flights,type:INDEX_PATTERN),

Screenshot 2024-09-05 at 12 44 55 PM

Testing the changes

  • local
  • unit tests

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

Deconstructing the dataSource caused an exception when no dataSource was set
with the query.

Accessing by dot notation with null operator fixes this issue.

Adding tests to prevent this happening again

Signed-off-by: Kawika Avilla <[email protected]>
Copy link
Contributor

github-actions bot commented Sep 5, 2024

❌ 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

github-actions bot commented Sep 5, 2024

❌ 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 Sep 5, 2024
@kavilla kavilla added the v2.17.0 label Sep 5, 2024
@kavilla kavilla changed the title [enhance] access datasource information with dot notation to fix MQL [discover] datasource dot notation to fix index patterns for PPL and SQL Sep 5, 2024
@kavilla kavilla changed the title [discover] datasource dot notation to fix index patterns for PPL and SQL [discover] undefined datasource fix for index patterns for PPL and SQL Sep 5, 2024
Copy link

codecov bot commented Sep 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.58%. Comparing base (80de45e) to head (d0a165e).
Report is 83 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8027      +/-   ##
==========================================
+ Coverage   60.55%   60.58%   +0.03%     
==========================================
  Files        3732     3732              
  Lines       88425    88425              
  Branches    13700    13700              
==========================================
+ Hits        53547    53575      +28     
+ Misses      31621    31590      -31     
- Partials     3257     3260       +3     
Flag Coverage Δ
Linux_1 28.75% <ø> (ø)
Linux_2 56.26% <ø> (ø)
Linux_3 37.44% <ø> (-0.01%) ⬇️
Linux_4 29.65% <100.00%> (+0.03%) ⬆️
Windows_1 28.77% <ø> (?)
Windows_2 56.22% <ø> (ø)
Windows_3 37.44% <ø> (?)
Windows_4 29.65% <100.00%> (+0.02%) ⬆️

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.

@kavilla
Copy link
Member Author

kavilla commented Sep 5, 2024

cypress existing flakey need to look into that. seems highlighting is rendering slower than cypress expected. that or it's not in view

@kavilla kavilla merged commit 06816d5 into opensearch-project:main Sep 5, 2024
78 of 82 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 5, 2024
…#8027)

Deconstructing the dataSource caused an exception when no dataSource was set with the query. This can be the case with index patterns that are created and pointed to the default. Most times the default is the local cluster so there is no data source object in the query the case of the local.

Accessing by dot notation with null operator fixes this issue. Adding tests to prevent this happening again.

With query enhancements enabled we should considered ensuring index patterns always have a datasource object in the query.

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 06816d5)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 5, 2024
…#8027)

Deconstructing the dataSource caused an exception when no dataSource was set with the query. This can be the case with index patterns that are created and pointed to the default. Most times the default is the local cluster so there is no data source object in the query the case of the local.

Accessing by dot notation with null operator fixes this issue. Adding tests to prevent this happening again.

With query enhancements enabled we should considered ensuring index patterns always have a datasource object in the query.

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 06816d5)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
kavilla pushed a commit that referenced this pull request Sep 5, 2024
…#8027) (#8028)

Deconstructing the dataSource caused an exception when no dataSource was set with the query. This can be the case with index patterns that are created and pointed to the default. Most times the default is the local cluster so there is no data source object in the query the case of the local.

Accessing by dot notation with null operator fixes this issue. Adding tests to prevent this happening again.

With query enhancements enabled we should considered ensuring index patterns always have a datasource object in the query.


(cherry picked from commit 06816d5)

Signed-off-by: Kawika Avilla <[email protected]>
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>
kavilla pushed a commit that referenced this pull request Sep 5, 2024
…#8027) (#8029)

Deconstructing the dataSource caused an exception when no dataSource was set with the query. This can be the case with index patterns that are created and pointed to the default. Most times the default is the local cluster so there is no data source object in the query the case of the local.

Accessing by dot notation with null operator fixes this issue. Adding tests to prevent this happening again.

With query enhancements enabled we should considered ensuring index patterns always have a datasource object in the query.


(cherry picked from commit 06816d5)

Signed-off-by: Kawika Avilla <[email protected]>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants