-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
ESQL: extend TranslationAware to all pushable expressions #120192
ESQL: extend TranslationAware to all pushable expressions #120192
Conversation
Merge esql-core and Esql* subclassing.
Hi @bpintea, I've created a changelog YAML for you. |
Pinging @elastic/es-analytical-engine (Team:Analytics) |
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.
Looks great - thanks!
👍
protected ExpressionTranslator<Kql> translator() { | ||
return new EsqlExpressionTranslators.KqlFunctionTranslator(); | ||
protected Query translate(TranslatorHandler handler) { | ||
return new KqlQuery(source(), (String) queryAsObject()); |
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.
Objects.toString(queryAsObject())
/** | ||
* Subinterface for expressions that can only process single values (and null out on MVs). | ||
*/ | ||
interface SingleValue extends TranslationAware { |
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.
SingleValueTranslationAware
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.
LGTM ❤️
Thanks Costin, Luigi. |
💔 Backport failed
You can use sqren/backport to manually backport by running |
…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)
…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 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 theSingleValueQuery
wrapping no longer needs to be performed explicitly by the implementer.TranslationAware
is now part of theorg.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 byTranslationAware
).