Enum Class TranslationAware.Translatable
java.lang.Object
java.lang.Enum<TranslationAware.Translatable>
org.elasticsearch.xpack.esql.capabilities.TranslationAware.Translatable
- All Implemented Interfaces:
Serializable,Comparable<TranslationAware.Translatable>,Constable
- Enclosing interface:
TranslationAware
How is this expression translatable?
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionfinish()Translate into aTranslationAware.FinishedTranslatablewhich never includesYES_BUT_RECHECK_NEGATED.negate()Returns the enum constant of this class with the specified name.static TranslationAware.Translatable[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NO
Not translatable at all. CallingTranslationAware.asQuery(org.elasticsearch.xpack.esql.optimizer.rules.physical.local.LucenePushdownPredicates, org.elasticsearch.xpack.esql.planner.TranslatorHandler)is an error. The expression will stay in the query plan and be filtered via aFilterOperator. Imaginekwd == "a"whenkwdis configured without a search index. -
YES
Entirely translatable into a lucene query. CallingTranslationAware.asQuery(org.elasticsearch.xpack.esql.optimizer.rules.physical.local.LucenePushdownPredicates, org.elasticsearch.xpack.esql.planner.TranslatorHandler)will produce a query that matches all documents matching this expression and only documents matching this expression. Imaginekwd == "a"whenkwdhas a search index and doc values - which is the default configuration. This will entirely remove the clause from theWHERE, removing the entireFilterOperatorif it's empty. Sometimes this allows us to push the entire top-n operation to lucene with aLuceneTopNSourceOperator. -
RECHECK
Translation requires a recheck. CallingTranslationAware.asQuery(org.elasticsearch.xpack.esql.optimizer.rules.physical.local.LucenePushdownPredicates, org.elasticsearch.xpack.esql.planner.TranslatorHandler)will produce a query that matches all documents matching this expression but might match more documents that do not match the expression. This will cause us to push a query to lucene and keep the query in the query plan, rechecking it via aFilterOperator. This can never push the entire top-n to Lucene, but it's still quite a lot better than the full scan fromNO.Imagine
kwd == "a"wherekwdhas a search index but doesn't have doc values. In that case we can find candidate matches in lucene but can't tell if those docs are single-valued. If they are multivalued they'll still match the query but won't match the expression. Thus, the double-checking. Technically we could just check for single-valued-ness in this case, but it's simpler to -
YES_BUT_RECHECK_NEGATED
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
finish
Translate into aTranslationAware.FinishedTranslatablewhich never includesYES_BUT_RECHECK_NEGATED. -
negate
-
merge
-