java.lang.Object
org.elasticsearch.xpack.esql.core.tree.Node<Expression>
org.elasticsearch.xpack.esql.core.expression.Expression
org.elasticsearch.xpack.esql.expression.predicate.operator.comparison.InSubquery
All Implemented Interfaces:
NamedWriteable, Writeable, Resolvable

public class InSubquery extends Expression
Unresolved expression for field IN (subquery) where the subquery is a full ES|QL query.

This node will be resolved by InSubqueryResolver into a concrete logical plan. InSubquery serves as the clean boundary between parsing and pre analysis, LogicalPlanBuilder creates an expression, InSubqueryResolver transforms it into a logical plan.

If any InSubquery expressions remain after InSubqueryResolver runs (i.e. they were used outside a WHERE clause), InSubqueryResolver raises a VerificationException.

  • Constructor Details

  • Method Details

    • value

      public Expression value()
    • subquery

      public LogicalPlan subquery()
    • dataType

      public DataType dataType()
      Description copied from class: Expression
      The DataType returned by executing the tree rooted at this expression. If Expression.typeResolved() returns an error then the behavior of this method is undefined. It may return a valid type. Or it may throw an exception. Or it may return a totally nonsensical type.
      Specified by:
      dataType in class Expression
    • nullable

      public Nullability nullable()
      Specified by:
      nullable in class Expression
    • getWriteableName

      public String getWriteableName()
    • writeTo

      public void writeTo(StreamOutput out)
    • info

      protected NodeInfo<InSubquery> info()
      Description copied from class: Node
      Normally, you want to use one of the static create methods to implement this.

      For QueryPlans, it is very important that the properties contain all of the expressions and references relevant to this node, and that all the properties are used in the provided constructor; otherwise query plan transformations like QueryPlan#transformExpressionsOnly(Function) will not have an effect.

      Specified by:
      info in class Node<Expression>
    • replaceChildren

      public Expression replaceChildren(List<Expression> newChildren)
      Specified by:
      replaceChildren in class Node<Expression>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Node<Expression>
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Node<Expression>