Class RLikeList
- All Implemented Interfaces:
NamedWriteable,Writeable,TranslationAware,TranslationAware.SingleValueTranslationAware,Resolvable,EvaluatorMapper
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
Expression.TypeResolutionNested classes/interfaces inherited from interface org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper
EvaluatorMapper.ToEvaluatorNested classes/interfaces inherited from interface org.elasticsearch.xpack.esql.capabilities.TranslationAware
TranslationAware.FinishedTranslatable, TranslationAware.SingleValueTranslationAware, TranslationAware.TranslatableNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from class org.elasticsearch.xpack.esql.core.expression.function.scalar.ScalarFunction
MAX_BYTES_REF_RESULT_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionRLikeList(Source source, Expression value, RLikePatternList patterns) The documentation for this function is in RLike, and shown to the users as `RLIKE` in the docs.RLikeList(Source source, Expression field, RLikePatternList rLikePattern, boolean caseInsensitive) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.lucene.search.QueryasLuceneQuery(MappedFieldType fieldType, org.apache.lucene.search.MultiTermQuery.RewriteMethod constantScoreRewrite, SearchExecutionContext context) Translates this expression into a LuceneQuery.asQuery(LucenePushdownPredicates pushdownPredicates, TranslatorHandler handler) Returns aQuerythat matches the field against the provided patterns.fold(FoldContext ctx) protected NodeInfo<? extends Expression> info()name()optimizeStringCasingWithInsensitiveRegexMatch(Expression unwrappedField, Predicate<String> matchesCaseFn) Pushes down string casing optimization by filtering patterns using the provided predicate.protected RLikeListreplaceChild(Expression newChild) protected Expression.TypeResolutionReturns the field that only supports single-value semantics.toEvaluator(EvaluatorMapper.ToEvaluator toEvaluator) Convert this into anEvalOperator.ExpressionEvaluator.translatable(LucenePushdownPredicates pushdownPredicates) Can this instance be translated or not? Usually checks whether the expression arguments are actual fields that exist in Lucene.voidwriteTo(StreamOutput out) Methods inherited from class org.elasticsearch.xpack.esql.core.expression.predicate.regex.RegexMatch
caseInsensitive, dataType, equals, foldable, hashCode, nullable, patternMethods inherited from class org.elasticsearch.xpack.esql.core.expression.function.scalar.UnaryScalarFunction
field, replaceChildrenMethods inherited from class org.elasticsearch.xpack.esql.core.expression.function.Function
arguments, functionNameMethods inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
canonical, canonicalize, childrenResolved, propertiesToString, references, resolved, semanticEquals, semanticHash, toString, typeResolvedMethods inherited from class org.elasticsearch.xpack.esql.core.tree.Node
anyMatch, children, collect, collectFirstChildren, collectLeaves, doCollectFirst, forEachDown, forEachDown, forEachDownMayReturnEarly, forEachProperty, forEachPropertyDown, forEachPropertyOnly, forEachPropertyUp, forEachUp, forEachUp, nodeName, nodeProperties, replaceChildrenSameSize, source, sourceLocation, sourceText, transformChildren, transformDown, transformDown, transformDown, transformNodeProps, transformPropertiesDown, transformPropertiesOnly, transformPropertiesUp, transformUp, transformUp, transformUpMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper
fold
-
Field Details
-
ENTRY
-
-
Constructor Details
-
RLikeList
The documentation for this function is in RLike, and shown to the users as `RLIKE` in the docs. -
RLikeList
public RLikeList(Source source, Expression field, RLikePatternList rLikePattern, boolean caseInsensitive)
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classUnaryScalarFunction- Throws:
IOException
-
name
-
getWriteableName
-
replaceChild
- Specified by:
replaceChildin classUnaryScalarFunction
-
translatable
Description copied from interface:TranslationAwareCan this instance be translated or not? Usually checks whether the expression arguments are actual fields that exist in Lucene. SeeTranslationAware.Translatablefor precisely what can be signaled from this method.- Specified by:
translatablein interfaceTranslationAware
-
asQuery
Returns aQuerythat matches the field against the provided patterns. For now, we only support a single pattern in the list for pushdown. -
asLuceneQuery
public org.apache.lucene.search.Query asLuceneQuery(MappedFieldType fieldType, org.apache.lucene.search.MultiTermQuery.RewriteMethod constantScoreRewrite, SearchExecutionContext context) Description copied from interface:TranslationAwareTranslates this expression into a LuceneQuery.Implementations should use the provided field type, rewrite method, and search execution context to construct an appropriate Lucene query for this expression. By default, this method throws
UnsupportedOperationException; override it in subclasses that support Lucene query translation. -
optimizeStringCasingWithInsensitiveRegexMatch
public Expression optimizeStringCasingWithInsensitiveRegexMatch(Expression unwrappedField, Predicate<String> matchesCaseFn) Pushes down string casing optimization by filtering patterns using the provided predicate. Returns a new RegexMatch or a Literal.FALSE if none match.- Specified by:
optimizeStringCasingWithInsensitiveRegexMatchin classRegexMatch<RLikePatternList>
-
info
- Specified by:
infoin classNode<Expression>
-
resolveType
- Overrides:
resolveTypein classRegexMatch<P extends AbstractStringPattern>
-
fold
- Overrides:
foldin classRegexMatch<P extends AbstractStringPattern>
-
toEvaluator
public EvalOperator.ExpressionEvaluator.Factory toEvaluator(EvaluatorMapper.ToEvaluator toEvaluator) Description copied from interface:EvaluatorMapperConvert this into anEvalOperator.ExpressionEvaluator.Note for implementors: If you are implementing this function, you should call the passed-in lambda on your children, after doing any other manipulation (casting, etc.) necessary.
Note for Callers: If you are attempting to call this method, and you have an
Expressionand aLayout, you likely want to callEvalMapper.toEvaluator(org.elasticsearch.xpack.esql.core.expression.FoldContext, org.elasticsearch.xpack.esql.core.expression.Expression, org.elasticsearch.xpack.esql.planner.Layout)instead. On the other hand, if you already have something that looks like the parameter for this method, you should call this method with that function.Build an
EvalOperator.ExpressionEvaluator.Factoryfor the tree of expressions rooted at this node. This is only guaranteed to return a sensible evaluator if this node has a valid type. If this node is a subclass ofExpressionthen "valid type" means thatExpression.typeResolved()returns a non-error resolution. If Expression.typeResolved() returns an error then this method may throw. Or return an evaluator that produces garbage. Or return an evaluator that throws when run.- Specified by:
toEvaluatorin interfaceEvaluatorMapper
-
singleValueField
Description copied from interface:TranslationAware.SingleValueTranslationAwareReturns the field that only supports single-value semantics.- Specified by:
singleValueFieldin interfaceTranslationAware.SingleValueTranslationAware
-
nodeString
- Overrides:
nodeStringin classFunction
-