Class NamedSubquery

All Implemented Interfaces:
NamedWriteable, Writeable, TelemetryAware, Resolvable, SortAgnostic

public class NamedSubquery extends Subquery
A Subquery that carries the view name it was resolved from.

Unlike plain Subquery, the name participates in equals(java.lang.Object) and hashCode(), which allows Node.transformDown to distinguish a newly-tagged subquery from its untagged predecessor. After view resolution, a post-processing pass converts UnionAll nodes containing NamedSubquery children into ViewUnionAll.

This class should only be used during query re-writing and not survive in the final query plan. If we decide to keep named subqueries as a feature later, we should add serialization support.

  • Constructor Details

  • Method Details

    • name

      public String name()
    • info

      protected NodeInfo<NamedSubquery> 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.

      Overrides:
      info in class Subquery
    • replaceChild

      public UnaryPlan replaceChild(LogicalPlan newChild)
      Overrides:
      replaceChild in class Subquery
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Subquery
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Subquery
    • nodeString

      public void nodeString(StringBuilder sb, Node.NodeStringFormat format)
      Description copied from class: Node
      Append this Node's string representation to sb. This does not include this node's Node.children().
      Overrides:
      nodeString in class Subquery
      Parameters:
      sb - target for the string
      format - configuration for rendering the string representation