Class Foldables
java.lang.Object
org.elasticsearch.xpack.esql.expression.Foldables
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA utility class to validate the type resolution of expressions before and after logical planning. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Objectstatic intintValueOf(Expression field, String sourceText, String fieldName) static IntegerlimitValue(Expression limitField, String sourceText) static Objectstatic ObjectqueryAsObject(Expression queryField, String sourceText) static StringqueryAsString(Expression queryField, String sourceText) static Expression.TypeResolutionresolveTypeLimit(Expression limitField, String sourceText, Foldables.TypeResolutionValidator validator) We check that the limit is not null and that if it is a literal, it is a positive integer During postOptimizationVerification folding is already done, so we also verify that it is definitively a literalstatic Expression.TypeResolutionresolveTypeQuery(Expression queryField, String sourceText, Foldables.TypeResolutionValidator validator) We check that the query is not null and that if it is a literal, it is a string During postOptimizationVerification folding is already done, so we also verify that it is definitively a literalstatic StringstringLiteralValueOf(Expression expression, String message) static ObjectvalueOf(FoldContext ctx, Expression e)
-
Constructor Details
-
Foldables
public Foldables()
-
-
Method Details
-
valueOf
-
stringLiteralValueOf
-
literalValueOf
-
extractLiteralOrReturnSelf
-
limitValue
-
resolveTypeLimit
public static Expression.TypeResolution resolveTypeLimit(Expression limitField, String sourceText, Foldables.TypeResolutionValidator validator) We check that the limit is not null and that if it is a literal, it is a positive integer During postOptimizationVerification folding is already done, so we also verify that it is definitively a literal -
resolveTypeQuery
public static Expression.TypeResolution resolveTypeQuery(Expression queryField, String sourceText, Foldables.TypeResolutionValidator validator) We check that the query is not null and that if it is a literal, it is a string During postOptimizationVerification folding is already done, so we also verify that it is definitively a literal -
queryAsObject
-
queryAsString
-
intValueOf
-