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
FieldsModifier and TypeFieldDescriptionprotected intprotected booleanprotected VectorContainerprotected intprotected HashPartitionprotected intprotected intprotected booleanprotected intprotected intprotected AbstractHashBinaryRecordBatch<T> protected intprotected intprotected HashPartition[]protected RecordBatchprotected BatchSchemaprotected Probe.ProbeStateprotected intprotected intprotected AbstractHashBinaryRecordBatch.SpilledPartition[]protected intprotected com.carrotsearch.hppc.IntArrayList - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionprotected voidexecuteProjectRightPhase(int currBuildPart) After the "inner" probe phase, finish up a Right (of Full) Join by projecting the unmatched rows of the build sideintprotected abstract voidhandleProbeResult(int probeIndex) protected intoutputRow(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.intPerform the probe, till the outgoing is full, or no more rows to probe.voidsetTargetOutputCount(int targetOutputRecords) protected voidsetup(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, waitMethods 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:
 setTargetOutputCountin interfaceProbe
 - 
getOutputCount
public int getOutputCount()- Specified by:
 getOutputCountin 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:
 probeAndProjectin interfaceProbe- Returns:
 - Num of output records
 - Throws:
 SchemaChangeException- SchemaChangeException
 - 
handleProbeResult
protected abstract void handleProbeResult(int probeIndex)  
 -