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

[Step 2][ESQL] Autocomplete part #148006

Merged
merged 15 commits into from
Jan 4, 2023

Conversation

alexwizp
Copy link
Contributor

@alexwizp alexwizp commented Dec 22, 2022

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:

image

  • do yarn kbn bootstrap

Checklist

@alexwizp alexwizp force-pushed the esql_autocomplete branch 2 times, most recently from aff9f0f to da94ab1 Compare December 23, 2022 09:10
@alexwizp alexwizp marked this pull request as ready for review January 3, 2023 09:03
@alexwizp alexwizp requested review from a team as code owners January 3, 2023 09:03
Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

@alexwizp this is soooo cool ❤️ Some comments:

  1. When I select a field for avg it adds this with "". Can we remove the "" because esql returns an error?

image

Same for by

image

  1. When I select the avg can I then immediately suggest the available fields? Because now I have to type a character to see the list

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

This works great!!
I tested it on the ESQL branch and works amazing

Can we

  1. Move all the monaco esql updates on a PR to target main as we already have them there and won't affect anything
  2. After merging in main, add the unified search changes into the feature branch

@stratoula
Copy link
Contributor

Last comments @alexwizp sorry!

  • On stats I should not see round and on eval I should not see agg functions
  • After round I can have mathematical operators (*,/,+,-). If we fix it we won't see the red line when I do this

image

@stratoula
Copy link
Contributor

YES! Now it works great ❤️

alexwizp added a commit that referenced this pull request Jan 3, 2023
## Summary

Autocomplete support for ESQL lang. Initially target branch for that PR
was
[elastic:feature-esql](https://github.com/elastic/kibana/tree/feature-esql)
but then we decided to merge it separately. This PR is as copy of
#148006

## 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`
@alexwizp
Copy link
Contributor Author

alexwizp commented Jan 3, 2023

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

kibana-ci commented Jan 3, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #9 / Discover discover async search should should clean the search session when navigating to SQL mode, and reinitialize when navigating back
  • [job] [logs] FTR Configs #9 / Discover discover async search should should clean the search session when navigating to SQL mode, and reinitialize when navigating back
  • [job] [logs] FTR Configs #6 / lens app - group 1 lens text based language tests should navigate to text based languages mode correctly
  • [job] [logs] FTR Configs #6 / lens app - group 1 lens text based language tests should navigate to text based languages mode correctly

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
unifiedSearch 286.2KB 286.8KB +561.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
@kbn/monaco 3 2 -1

Total ESLint disabled count

id before after diff
@kbn/monaco 8 7 -1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@stratoula stratoula merged commit 1b1ab0d into elastic:feature-esql Jan 4, 2023
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.

4 participants