Class RuleUtils
java.lang.Object
org.elasticsearch.xpack.esql.optimizer.rules.RuleUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.elasticsearch.core.Tuple<List<Alias>, List<NamedExpression>> aliasedNulls(List<Attribute> outputAttributes, Predicate<Attribute> shouldBeReplaced) static AttributeMap<Expression> foldableReferences(LogicalPlan plan, LogicalOptimizerContext ctx) Collects references to foldables from the given logical plan, returning anAttributeMapthat maps foldable aliases to their corresponding literal values.
-
Method Details
-
aliasedNulls
public static org.elasticsearch.core.Tuple<List<Alias>,List<NamedExpression>> aliasedNulls(List<Attribute> outputAttributes, Predicate<Attribute> shouldBeReplaced) - Parameters:
outputAttributes- The original output attributes.shouldBeReplaced- A predicate to determine which attributes should be replaced with null aliases.- Returns:
- a tuple of two lists:
- A list of aliases to null literals for those data types in the
outputAttributesthatshouldBeReplaced. - A list of named expressions where attributes that match the predicate are replaced with their corresponding null alias.
- A list of aliases to null literals for those data types in the
-
foldableReferences
public static AttributeMap<Expression> foldableReferences(LogicalPlan plan, LogicalOptimizerContext ctx) Collects references to foldables from the given logical plan, returning anAttributeMapthat maps foldable aliases to their corresponding literal values.- Parameters:
plan- The logical plan to analyze.ctx- The optimizer context providing fold context.- Returns:
- An
AttributeMapcontaining foldable references and their literal values.
-