ESQL: extend TranslationAware to all pushable expressions#120192
Merged
elasticsearchmachine merged 10 commits intoelastic:mainfrom Jan 17, 2025
Merged
ESQL: extend TranslationAware to all pushable expressions#120192elasticsearchmachine merged 10 commits intoelastic:mainfrom
elasticsearchmachine merged 10 commits intoelastic:mainfrom
Conversation
Merge esql-core and Esql* subclassing.
Collaborator
|
Hi @bpintea, I've created a changelog YAML for you. |
6 tasks
Collaborator
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
costin
approved these changes
Jan 17, 2025
| protected ExpressionTranslator<Kql> translator() { | ||
| return new EsqlExpressionTranslators.KqlFunctionTranslator(); | ||
| protected Query translate(TranslatorHandler handler) { | ||
| return new KqlQuery(source(), (String) queryAsObject()); |
Member
There was a problem hiding this comment.
Objects.toString(queryAsObject())
| /** | ||
| * Subinterface for expressions that can only process single values (and null out on MVs). | ||
| */ | ||
| interface SingleValue extends TranslationAware { |
Contributor
Author
|
Thanks Costin, Luigi. |
Collaborator
💔 Backport failed
You can use sqren/backport to manually backport by running |
bpintea
added a commit
to bpintea/elasticsearch
that referenced
this pull request
Jan 20, 2025
…0192) This expands the `TranslationAware` interface for expressions that support translations to Lucene query and moves the implementations of these translations from a centralised place (ExpressionTranslators) to the respective expression classes. `TranslationAware` has now a subinterface, `SingleValueTranslationAware`, for expressions that need to implement the single-value logic (`null` out on MVs). So the `SingleValueQuery` wrapping no longer needs to be performed explicitly by the implementer. `TranslationAware` is now part of the `org.elasticsearch.xpack.esql.capabilities` package, together with the other interfaces that extensions needs to implement to be used by the core services (verifier and optimizer). To allow this, some logical nodes have been moved from core in the ESQL proper (where also `LucenePushdownPredicates` resides, used by `TranslationAware`). (cherry picked from commit a867127)
elasticsearchmachine
pushed a commit
that referenced
this pull request
Jan 20, 2025
…120475) This expands the `TranslationAware` interface for expressions that support translations to Lucene query and moves the implementations of these translations from a centralised place (ExpressionTranslators) to the respective expression classes. `TranslationAware` has now a subinterface, `SingleValueTranslationAware`, for expressions that need to implement the single-value logic (`null` out on MVs). So the `SingleValueQuery` wrapping no longer needs to be performed explicitly by the implementer. `TranslationAware` is now part of the `org.elasticsearch.xpack.esql.capabilities` package, together with the other interfaces that extensions needs to implement to be used by the core services (verifier and optimizer). To allow this, some logical nodes have been moved from core in the ESQL proper (where also `LucenePushdownPredicates` resides, used by `TranslationAware`). (cherry picked from commit a867127)
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.
This expands the
TranslationAwareinterface for expressions that support translations to Lucene query and moves the implementations of these translations from a centralised place (ExpressionTranslators) to the respective expression classes.TranslationAwarehas now a subinterface,SingleValueTranslationAware, for expressions that need to implement the single-value logic (nullout on MVs). So theSingleValueQuerywrapping no longer needs to be performed explicitly by the implementer.TranslationAwareis now part of theorg.elasticsearch.xpack.esql.capabilitiespackage, together with the other interfaces that extensions needs to implement to be used by the core services (verifier and optimizer).To allow this, some logical nodes have been moved from core in the ESQL proper (where also
LucenePushdownPredicatesresides, used byTranslationAware).