Class ProbeTemplate<T extends PhysicalOperator>

java.lang.Object
org.apache.drill.exec.physical.impl.join.ProbeTemplate<T>
All Implemented Interfaces:
Probe
Direct Known Subclasses:
HashJoinProbeTemplate, HashSetOpProbeTemplate

public abstract class ProbeTemplate<T extends PhysicalOperator> extends Object implements Probe
  • Field Details

    • container

      protected VectorContainer container
    • probeBatch

      protected RecordBatch probeBatch
    • probeSchema

      protected BatchSchema probeSchema
    • recordsToProcess

      protected int recordsToProcess
    • recordsProcessed

      protected int recordsProcessed
    • outputRecords

      protected int outputRecords
    • getNextRecord

      protected boolean getNextRecord
    • currentCompositeIdx

      protected int currentCompositeIdx
    • probeState

      protected Probe.ProbeState probeState
    • unmatchedBuildIndexes

      protected com.carrotsearch.hppc.IntArrayList unmatchedBuildIndexes
    • partitions

      protected HashPartition[] partitions
    • currPartition

      protected HashPartition currPartition
    • currRightPartition

      protected int currRightPartition
    • cycleNum

      protected int cycleNum
    • spilledInners

    • buildSideIsEmpty

      protected boolean buildSideIsEmpty
    • numPartitions

      protected int numPartitions
    • partitionMask

      protected int partitionMask
    • bitsInMask

      protected int bitsInMask
    • numberOfBuildSideColumns

      protected int numberOfBuildSideColumns
    • targetOutputRecords

      protected int targetOutputRecords
    • outgoingBatch

      protected AbstractHashBinaryRecordBatch<T extends PhysicalOperator> outgoingBatch
  • Constructor Details

    • ProbeTemplate

      public ProbeTemplate()
  • Method Details

    • setup

      protected void setup(RecordBatch probeBatch, RecordBatch.IterOutcome leftStartState, HashPartition[] partitions, int cycleNum, VectorContainer container, AbstractHashBinaryRecordBatch.SpilledPartition[] spilledInners, boolean buildSideIsEmpty, int numPartitions) throws SchemaChangeException
      Throws:
      SchemaChangeException
    • setTargetOutputCount

      public void setTargetOutputCount(int targetOutputRecords)
      Specified by:
      setTargetOutputCount in interface Probe
    • getOutputCount

      public int getOutputCount()
      Specified by:
      getOutputCount in interface Probe
    • outputRow

      protected int outputRow(ArrayList<VectorContainer> buildSrcContainers, int compositeBuildSrcIndex, VectorContainer probeSrcContainer, int probeSrcIndex)
      A special version of the VectorContainer's appendRow for the HashJoin; (following a probe) it copies the build and probe sides into the outgoing container. (It uses a composite index for the build side). If any of the build/probe source containers is null, then that side is not appended (effectively outputing nulls for that side's columns).
      Parameters:
      buildSrcContainers - The containers list for the right/inner side
      compositeBuildSrcIndex - Composite build index
      probeSrcContainer - The single container for the left/outer side
      probeSrcIndex - Index in the outer container
      Returns:
      Number of rows in this container (after the append)
    • executeProjectRightPhase

      protected void executeProjectRightPhase(int currBuildPart)
      After the "inner" probe phase, finish up a Right (of Full) Join by projecting the unmatched rows of the build side
      Parameters:
      currBuildPart - Which partition
    • probeAndProject

      public int probeAndProject() throws SchemaChangeException
      Perform the probe, till the outgoing is full, or no more rows to probe. Performs the inner or left-outer join while there are left rows, when done, continue with right-outer, if appropriate.
      Specified by:
      probeAndProject in interface Probe
      Returns:
      Num of output records
      Throws:
      SchemaChangeException - SchemaChangeException
    • handleProbeResult

      protected abstract void handleProbeResult(int probeIndex)