Class NestedLoopJoinTemplate
java.lang.Object
org.apache.drill.exec.physical.impl.join.NestedLoopJoinTemplate
- All Implemented Interfaces:
NestedLoopJoin
-
Field Summary
Fields inherited from interface org.apache.drill.exec.physical.impl.join.NestedLoopJoin
TEMPLATE_DEFINITION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract boolean
doEval
(int leftIndex, int batchIndex, int recordIndexWithinBatch) abstract void
doSetup
(FragmentContext context, VectorContainer rightContainer, RecordBatch leftBatch, RecordBatch outgoing) abstract void
emitLeft
(int leftIndex, int outIndex) abstract void
emitRight
(int batchIndex, int recordIndexWithinBatch, int outIndex) int
outputRecords
(org.apache.calcite.rel.core.JoinRelType joinType) Main entry point for producing the output records.void
setTargetOutputCount
(int targetOutputRecords) void
setupNestedLoopJoin
(FragmentContext context, RecordBatch left, ExpandableHyperContainer rightContainer, LinkedList<Integer> rightCounts, NestedLoopJoinBatch outgoing) Method initializes necessary state and invokes the doSetup() to set the input and output value vector references.
-
Constructor Details
-
NestedLoopJoinTemplate
public NestedLoopJoinTemplate()
-
-
Method Details
-
setupNestedLoopJoin
public void setupNestedLoopJoin(FragmentContext context, RecordBatch left, ExpandableHyperContainer rightContainer, LinkedList<Integer> rightCounts, NestedLoopJoinBatch outgoing) Method initializes necessary state and invokes the doSetup() to set the input and output value vector references.- Specified by:
setupNestedLoopJoin
in interfaceNestedLoopJoin
- Parameters:
context
- Fragment contextleft
- Current left input batch being processedrightContainer
- Hyper containerrightCounts
- Counts for each right containeroutgoing
- Output batch
-
setTargetOutputCount
public void setTargetOutputCount(int targetOutputRecords) - Specified by:
setTargetOutputCount
in interfaceNestedLoopJoin
-
outputRecords
public int outputRecords(org.apache.calcite.rel.core.JoinRelType joinType) Main entry point for producing the output records. Thin wrapper around populateOutgoingBatch(), this method controls which left batch we are processing and fetches the next left input batch once we exhaust the current one.- Specified by:
outputRecords
in interfaceNestedLoopJoin
- Parameters:
joinType
- join type (INNER ot LEFT)- Returns:
- the number of records produced in the output batch
-
doSetup
public abstract void doSetup(@Named("context") FragmentContext context, @Named("rightContainer") VectorContainer rightContainer, @Named("leftBatch") RecordBatch leftBatch, @Named("outgoing") RecordBatch outgoing) - Specified by:
doSetup
in interfaceNestedLoopJoin
-
emitRight
public abstract void emitRight(@Named("batchIndex") int batchIndex, @Named("recordIndexWithinBatch") int recordIndexWithinBatch, @Named("outIndex") int outIndex) - Specified by:
emitRight
in interfaceNestedLoopJoin
-
emitLeft
public abstract void emitLeft(@Named("leftIndex") int leftIndex, @Named("outIndex") int outIndex) - Specified by:
emitLeft
in interfaceNestedLoopJoin
-
doEval
protected abstract boolean doEval(@Named("leftIndex") int leftIndex, @Named("rightBatchIndex") int batchIndex, @Named("rightRecordIndexWithinBatch") int recordIndexWithinBatch)
-