WIP - Java Wrapper for Elasticsearch's ES|QL Parser#6207
Draft
eric-forte-elastic wants to merge 11 commits into
Draft
WIP - Java Wrapper for Elasticsearch's ES|QL Parser#6207eric-forte-elastic wants to merge 11 commits into
eric-forte-elastic wants to merge 11 commits into
Conversation
Contributor
Enhancement - GuidelinesThese guidelines serve as a reminder set of considerations when addressing adding a feature to the code. Documentation and Context
Code Standards and Practices
Testing
Additional Checks
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Issue link(s):
Summary - What I changed
ES|QL query verification used to require a live Elasticsearch cluster: we'd create test indices with the right mappings, rewrite the rule's query to use them, send it to
_query, and tear the indices down. This provided appropriate errors and some syntax validation and query parsing but also required a stack.This PR introduces a small JVM daemon that wraps Elasticsearch's ES|QL
EsqlParserandVerifierwhich Kibana uses.Note
This assumes that it is preferable to add a Java lib to the repo instead of using a remote stack. This is a large assumption and may not be what we want to do. Adding another language could incur a significant maintenance burden and we should consider this before merging.
Also 2 other things need to be resolved:
How To Test
This PR wires the JVM into the existing python ES|QL validation pipeline. Using view rule with the remote existing validation flags will use the JVM instead and produce the same results.
Example Run
You can test all rules with (takes ~4min vs 10min using remote stack)
You can also test the Java validation directly using the following script as an example.
Test Script
Checklist
bug,enhancement,schema,maintenance,Rule: New,Rule: Deprecation,Rule: Tuning,Hunt: New, orHunt: Tuningso guidelines can be generatedmeta:rapid-mergelabel if planning to merge within 24 hoursContributor checklist