Class ExternalFieldExtractExec

All Implemented Interfaces:
NamedWriteable, Writeable

public class ExternalFieldExtractExec extends UnaryExec
Local-only physical plan node that materializes deferred ("wide") columns for the rows that survive a per-driver TopN above an ExternalSourceExec.

Inserted by InsertExternalFieldExtraction immediately above the TopN when the source's format supports column extraction. The rule narrows the source to sort-key + predicate columns (plus a synthetic _rowPosition); this node consumes the narrow output and loads the remaining columns for the at-most-LIMIT rows the TopN selected. The _rowPosition channel is stripped from the output so downstream operators see the same shape as if no late materialization had happened.

NOT serialized. Created by the local physical optimizer on the data node after the plan fragment arrives over the wire; consumed by LocalExecutionPlanner on the same JVM. Same lifecycle as ExternalSourceExec.pushedFilter and ExternalSourceExec.pushedLimit.

  • Constructor Details

  • Method Details

    • attributesToExtract

      public List<Attribute> attributesToExtract()
    • rowPositionAttribute

      public Attribute rowPositionAttribute()
    • output

      public List<Attribute> output()
      Description copied from class: QueryPlan
      The ordered list of attributes (i.e. columns) this plan produces when executed. Must be called only on resolved plans, otherwise may throw an exception or return wrong results.
      Overrides:
      output in class UnaryExec
    • replaceChild

      public ExternalFieldExtractExec replaceChild(PhysicalPlan newChild)
      Specified by:
      replaceChild in class UnaryExec
    • computeReferences

      protected AttributeSet computeReferences()
      The only attribute this node requires from its child output is _rowPosition — the key into the per-driver source-extractor registry. attributesToExtract are produced by this node, not consumed from the child; advertising them as references would mislead column-pruning rules into pinning them on the (narrowed) source.
      Overrides:
      computeReferences in class QueryPlan<PhysicalPlan>
    • info

      protected NodeInfo<? extends ExternalFieldExtractExec> 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<PhysicalPlan>
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Throws:
      IOException
    • getWriteableName

      public String getWriteableName()
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class UnaryExec