Class NestedLoopJoinTemplate

java.lang.Object
org.apache.drill.exec.physical.impl.join.NestedLoopJoinTemplate
All Implemented Interfaces:
NestedLoopJoin

public abstract class NestedLoopJoinTemplate extends Object implements NestedLoopJoin
  • 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 interface NestedLoopJoin
      Parameters:
      context - Fragment context
      left - Current left input batch being processed
      rightContainer - Hyper container
      rightCounts - Counts for each right container
      outgoing - Output batch
    • setTargetOutputCount

      public void setTargetOutputCount(int targetOutputRecords)
      Specified by:
      setTargetOutputCount in interface NestedLoopJoin
    • 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 interface NestedLoopJoin
      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 interface NestedLoopJoin
    • emitRight

      public abstract void emitRight(@Named("batchIndex") int batchIndex, @Named("recordIndexWithinBatch") int recordIndexWithinBatch, @Named("outIndex") int outIndex)
      Specified by:
      emitRight in interface NestedLoopJoin
    • emitLeft

      public abstract void emitLeft(@Named("leftIndex") int leftIndex, @Named("outIndex") int outIndex)
      Specified by:
      emitLeft in interface NestedLoopJoin
    • doEval

      protected abstract boolean doEval(@Named("leftIndex") int leftIndex, @Named("rightBatchIndex") int batchIndex, @Named("rightRecordIndexWithinBatch") int recordIndexWithinBatch)