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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.drill.exec.physical.impl.join.Probe
Probe.ProbeState
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected boolean
protected VectorContainer
protected int
protected HashPartition
protected int
protected int
protected boolean
protected int
protected int
protected AbstractHashBinaryRecordBatch<T>
protected int
protected int
protected HashPartition[]
protected RecordBatch
protected BatchSchema
protected Probe.ProbeState
protected int
protected int
protected AbstractHashBinaryRecordBatch.SpilledPartition[]
protected int
protected com.carrotsearch.hppc.IntArrayList
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
executeProjectRightPhase
(int currBuildPart) After the "inner" probe phase, finish up a Right (of Full) Join by projecting the unmatched rows of the build sideint
protected abstract void
handleProbeResult
(int probeIndex) 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.int
Perform the probe, till the outgoing is full, or no more rows to probe.void
setTargetOutputCount
(int targetOutputRecords) protected void
setup
(RecordBatch probeBatch, RecordBatch.IterOutcome leftStartState, HashPartition[] partitions, int cycleNum, VectorContainer container, AbstractHashBinaryRecordBatch.SpilledPartition[] spilledInners, boolean buildSideIsEmpty, int numPartitions) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.drill.exec.physical.impl.join.Probe
changeToFinalProbeState, setup, setup
-
Field Details
-
container
-
probeBatch
-
probeSchema
-
recordsToProcess
protected int recordsToProcess -
recordsProcessed
protected int recordsProcessed -
outputRecords
protected int outputRecords -
getNextRecord
protected boolean getNextRecord -
currentCompositeIdx
protected int currentCompositeIdx -
probeState
-
unmatchedBuildIndexes
protected com.carrotsearch.hppc.IntArrayList unmatchedBuildIndexes -
partitions
-
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
-
-
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 interfaceProbe
-
getOutputCount
public int getOutputCount()- Specified by:
getOutputCount
in interfaceProbe
-
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 sidecompositeBuildSrcIndex
- Composite build indexprobeSrcContainer
- The single container for the left/outer sideprobeSrcIndex
- 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
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 interfaceProbe
- Returns:
- Num of output records
- Throws:
SchemaChangeException
- SchemaChangeException
-
handleProbeResult
protected abstract void handleProbeResult(int probeIndex)
-