Class NamedExpressions

java.lang.Object
org.elasticsearch.xpack.esql.expression.NamedExpressions

public class NamedExpressions extends Object
  • Constructor Details

    • NamedExpressions

      public NamedExpressions()
  • Method Details

    • mergeOutputAttributes

      public static List<Attribute> mergeOutputAttributes(List<? extends NamedExpression> fields, List<? extends NamedExpression> childOutput)
      Calculates the actual output of a command given the new attributes plus the existing inputs that are emitted as outputs
      Parameters:
      fields - the fields added by the command
      childOutput - the command input that has to be propagated as output
      Returns:
    • mergeOutputExpressions

      public static List<NamedExpression> mergeOutputExpressions(List<? extends NamedExpression> fields, List<? extends NamedExpression> childOutput)
      Merges output expressions of a command given the new attributes plus the existing inputs that are emitted as outputs. As a general rule, child output will come first in the list, followed by the new fields. In case of name collisions, only the last entry is preserved (previous expressions with the same name are discarded) and the new attributes have precedence over the child output.
      Parameters:
      fields - the fields added by the command
      childOutput - the command input that has to be propagated as output
      Returns: