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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleandoEval(int leftIndex, int batchIndex, int recordIndexWithinBatch) abstract voiddoSetup(FragmentContext context, VectorContainer rightContainer, RecordBatch leftBatch, RecordBatch outgoing) abstract voidemitLeft(int leftIndex, int outIndex) abstract voidemitRight(int batchIndex, int recordIndexWithinBatch, int outIndex) intoutputRecords(org.apache.calcite.rel.core.JoinRelType joinType) Main entry point for producing the output records.voidsetTargetOutputCount(int targetOutputRecords) voidsetupNestedLoopJoin(FragmentContext context, RecordBatch left, RecordBatch.IterOutcome leftOutcome, 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, RecordBatch.IterOutcome leftOutcome, 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:
setupNestedLoopJoinin interfaceNestedLoopJoin- Parameters:
context- Fragment contextleft- Current left input batch being processedleftOutcome- Last left outcomerightContainer- Hyper containerrightCounts- Counts for each right containeroutgoing- Output batch
-
setTargetOutputCount
public void setTargetOutputCount(int targetOutputRecords) - Specified by:
setTargetOutputCountin interfaceNestedLoopJoin
-
outputRecords
public int outputRecords(org.apache.calcite.rel.core.JoinRelType joinType) throws SchemaChangeException 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:
outputRecordsin interfaceNestedLoopJoin- Parameters:
joinType- join type (INNER ot LEFT)- Returns:
- the number of records produced in the output batch
- Throws:
SchemaChangeException
-
doSetup
public abstract void doSetup(@Named("context") FragmentContext context, @Named("rightContainer") VectorContainer rightContainer, @Named("leftBatch") RecordBatch leftBatch, @Named("outgoing") RecordBatch outgoing) - Specified by:
doSetupin interfaceNestedLoopJoin
-
emitRight
public abstract void emitRight(@Named("batchIndex") int batchIndex, @Named("recordIndexWithinBatch") int recordIndexWithinBatch, @Named("outIndex") int outIndex) - Specified by:
emitRightin interfaceNestedLoopJoin
-
emitLeft
public abstract void emitLeft(@Named("leftIndex") int leftIndex, @Named("outIndex") int outIndex) - Specified by:
emitLeftin interfaceNestedLoopJoin
-
doEval
protected abstract boolean doEval(@Named("leftIndex") int leftIndex, @Named("rightBatchIndex") int batchIndex, @Named("rightRecordIndexWithinBatch") int recordIndexWithinBatch)
-