-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ES|QL] Technical preview in Discover and Dashboards #146971
Conversation
Documentation preview: |
## Summary Autocomplete support for ESQL lang. ## Notes: Important: please do `yarn kbn clean & yarn kbn bootstrap` before testing. ## How to update syntax. `antlr` syntax was copied from `ES` and was slightly modified. In case if you need to update it please follow next steps: - modify `esql_parser.g4 `and/or `esql_lexer.g4` files - go to `kbn-monaco` package and execute `bazel clean & npm run build:antlr4ts:painless` - go to /painless_parser.ts file and revert the following change: <img width="478" alt="image" src="https://user-images.githubusercontent.com/20072247/209540586-bb77cad1-a6f0-42fa-9875-025bd4afbace.png"> - do `yarn kbn bootstrap` ### Checklist Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Stratoula Kalafateli <[email protected]>
Co-authored-by: Matthias Wilhelm <[email protected]>
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.
Did an initial code review and it's looking really good overall! I didn't see anything that jumped out to me as an issue, and mostly just left some minor suggestions and nits for now. Will followup soon with feedback from my local testing.
src/plugins/discover/public/application/main/hooks/use_test_based_query_language.test.tsx
Outdated
Show resolved
Hide resolved
src/plugins/discover/public/application/main/hooks/use_test_based_query_language.test.tsx
Outdated
Show resolved
Hide resolved
src/plugins/discover/public/application/main/hooks/use_test_based_query_language.test.tsx
Outdated
Show resolved
Hide resolved
src/plugins/unified_search/public/dataview_picker/change_dataview.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/lens_configuration_flyout.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/datasources/text_based/utils.test.ts
Outdated
Show resolved
Hide resolved
@davismcphee thanx a ton for the thorough code review! I have addressed everything here 6b75898 |
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.
Code review 👍
Left few nitpick comments but not a blocker 🎉
packages/kbn-text-based-editor/src/text_based_languages_editor.styles.ts
Outdated
Show resolved
Hide resolved
src/plugins/discover/public/application/main/components/layout/discover_documents.tsx
Outdated
Show resolved
Hide resolved
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.
Fantastic work on this, it's so exiting to finally see ES|QL in Discover! I tested locally pretty extensively today and for the most part didn't encounter any broken functionality or major bugs. I did notice two main issues though:
You mentioned this in the summary regarding autocomplete issues:
There is a bug in autocomplete, sometimes writing a query overwrites the existing one, will deal with it in a future PR
I ran into this quite often in my testing where after autocompleting, the ES|QL editor would be completely bugged out and overwrite characters, not accept characters, lose syntax highlighting, or even get out of sync. It sounds like this is a known issue with plans to improve it, so I won't block the merge over it, but as a user it was quite frustrating, so hopefully we can get it sorted quickly.
I also noticed a lot of scenarios where duplicate requests are being fired in ES|QL mode, sometimes up to 3 extra fetches at once. Again since it's technical preview, I'll leave it up to you to decide if this is something we're ok living with for now (data views seem unaffected which is the main thing to me), but I would definitely suggest we prioritize addressing this soon.
I see there's already an issue for some of the extra fetches in #165192, but I noticed a number of other scenarios in my testing too:
- 1 extra fetch on chart hide
- 1 extra fetch on page reload when a chart is visible
- 1 extra fetch when changing from an index where the vis is hidden to one where it's shown
- 3 extra fetches when navigating back from Dashboard to Discover after adding an ES|QL Discover vis
- 3 extra fetches when saving or opening a saved search
Maybe we can add these cases to #165192 and expand it into an issue for addressing the extra fetch issue more broadly? I may be able to help with some of this once I can find some time for it.
One thing I noticed that I think existed before this PR but would be good to make a note to fix is the disabled time picker tooltip uses esql
instead of ES|QL
:
Another thing that would be good followup work for another PR is adding some details to the ES|QL request for the inspector. I saw you mentioned the ES|QL search implementation is pretty basic for now, maybe something to consider when evolving this:
Otherwise I created a very small PR with minor cleanup of the remaining references to SQL
I found in Discover and Unified Histogram (no functionality changes): #165426. Feel free to merge to this PR if you want, or I can point it at main
instead once this is merged.
And lastly I left a couple of suggestions for places where additional unit tests would be ideal. I get there's some urgency on this PR so again I won't block on it, but it would be great to consider improving the testing in those areas when we can.
My only other feedback is that it would be great to get a quick review from @lukasolson on the search changes if possible since he's most familiar with the area on our team.
Thanks again for all the effort on this @stratoula! This really is an amazing feature and milestone for Kibana and Discover 🙌
src/plugins/unified_histogram/public/layout/hooks/use_lens_suggestions.ts
Show resolved
Hide resolved
src/plugins/unified_histogram/public/layout/hooks/use_lens_suggestions.ts
Show resolved
Hide resolved
src/plugins/unified_histogram/public/layout/hooks/use_lens_suggestions.ts
Show resolved
Hide resolved
src/plugins/discover/public/application/main/hooks/use_text_based_query_language.ts
Outdated
Show resolved
Hide resolved
@davismcphee thanx a lot for the review
Updated!
The ES team wants to work on async search of the esql api. At this point we can discuss together how we want to implement it with some help from @lukasolson as he knows this area better and we can revisit the inspector. We can also have a follow up PR if Lukas think that we can do something better on the search changes.
Thanx a ton for this! I will merge when CI is green
I created an issue and we can deal with it on followup PR(s) |
@elasticmachine merge upstream |
## Summary This PR updates the remaining references to SQL with ES|QL in Discover and Unified Histogram. Co-authored-by: Stratoula Kalafateli <[email protected]>
💔 Build FailedFailed CI Steps
Test Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
I am merging it as the serverless obs tests failures are irrelevant with this PR changes |
Summary
Closes #137810
Part of #163248
This PR is the first iteration of the new ES|QL language in kibana. The majority of the functionality is based on the existing functionality for SQL (which has already been merged). This builds on top of it to enable the functionality for ES|QL. We decided to remove SQL for now so this PR enables ES|QL and hides SQL. We are not removing the code for now.
Important notes:
Changes from SQL:
Discover view with non transformational commands
Discover view with transformational commands
Missing
Checklist