Class Expressions
java.lang.Object
org.elasticsearch.xpack.esql.core.expression.Expressions
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<Tuple<Attribute, Expression>> aliases(List<? extends NamedExpression> named) static booleananyMatch(List<? extends Expression> exps, Predicate<? super Expression> predicate) asAttributes(List<? extends NamedExpression> named) static Attributestatic List<Expression> canonicalize(List<? extends Expression> exps) static booleanequalsAsAttribute(Expression left, Expression right) fold(FoldContext ctx, List<? extends Expression> exps) static booleanfoldable(List<? extends Expression> exps) static Stringid(Expression e) static booleanIs this Expression guaranteed to have only thenullvalue.static booleanstatic booleanlistSemanticEqualsIgnoreOrder(List<Expression> left, List<Expression> right) static booleanmatch(List<? extends Expression> exps, Predicate<? super Expression> predicate) static Stringname(Expression e) names(Collection<? extends Expression> e) static Nullabilitynullable(List<? extends Expression> exps) Return the logical AND of a list ofNullabilitystatic AttributeSetreferences(List<? extends Expression> exps) toReferenceAttributesPreservingIds(List<? extends NamedExpression> named, List<Attribute> existingOutput) Converts named expressions toReferenceAttributes, preservingNameIds for attributes whose name matches one inexistingOutput.
-
Method Details
-
asAttributes
-
toReferenceAttributesPreservingIds
public static List<Attribute> toReferenceAttributesPreservingIds(List<? extends NamedExpression> named, List<Attribute> existingOutput) Converts named expressions toReferenceAttributes, preservingNameIds for attributes whose name matches one inexistingOutput. Genuinely new attributes get fresh NameIds.Exceptions to the
ReferenceAttributeconversion:- A
FieldAttributebacked by aTypeConflictedField(ambiguous type across indices) is converted to anUnsupportedAttributeviaFieldAttribute.flagTypeConflicts(), so the analyzer can surface a clear user-facing error. Exception: a two-legged PUNK (TypeConflictedField.isSingleTypePotentiallyUnmapped()) keeps its single mapped type on theReferenceAttributeso it surfaces through a Fork/UnionAll output. - An
ExternalMetadataAttributeis rebuilt as the same subtype with the preserved id. The "virtual column" identity must survive operators that re-class their output (e.g.Fork.refreshedOutput) because downstream rules such asAnalyzer.planWithoutSyntheticAttributes(which strips_file.*from the default top-level projection) and the predicate-pushdown helpers (PushdownPredicates#isVirtualColumn) test this subtype to decide whether an attribute is a virtual column or a real data column. Erasing the type would silently leak_file.*into default output and would also re-enable predicate pushdown on virtual columns past a Fork.
- A
-
anyMatch
public static boolean anyMatch(List<? extends Expression> exps, Predicate<? super Expression> predicate) -
match
public static boolean match(List<? extends Expression> exps, Predicate<? super Expression> predicate) -
nullable
Return the logical AND of a list ofNullabilityUNKNOWN AND TRUE/FALSE/UNKNOWN = UNKNOWN FALSE AND FALSE = FALSE TRUE AND FALSE/TRUE = TRUE
-
canonicalize
-
foldable
-
fold
-
references
-
name
-
isGuaranteedNull
Is this Expression guaranteed to have only thenullvalue. Expressions thatExpression.fold(org.elasticsearch.xpack.esql.core.expression.FoldContext)tonullmay returnfalsehere, but should eventually be folded into aLiteralcontainingnullwhich will returntruefrom here. -
names
-
attribute
-
isPresent
-
equalsAsAttribute
-
listSemanticEqualsIgnoreOrder
-
aliases
-
id
-