Skip to content

SortMergeJoinScanner

Creating Instance

SortMergeJoinScanner takes the following to be created:

  • streamedKeyGenerator Projection
  • bufferedKeyGenerator Projection
  • Key Ordering[InternalRow]
  • Streamed RowIterator
  • Buffered RowIterator
  • inMemoryThreshold
  • spillThreshold
  • eagerCleanupResources (() => Unit)
  • onlyBufferFirstMatch flag (default: false)

SortMergeJoinScanner is created when:

  • SortMergeJoinExec physical operator is requested to doExecute (for InnerLike, LeftOuter, RightOuter, LeftSemi, LeftAnti, ExistenceJoin joins)

ExternalAppendOnlyUnsafeRowArray

SortMergeJoinScanner creates an ExternalAppendOnlyUnsafeRowArray (with the given inMemoryThreshold and spillThreshold thresholds) when created.

The ExternalAppendOnlyUnsafeRowArray is requested to add an UnsafeRow in bufferMatchingRows.

The ExternalAppendOnlyUnsafeRowArray is cleared in findNextInnerJoinRows, findNextOuterJoinRows and bufferMatchingRows.

getBufferedMatches

getBufferedMatches: ExternalAppendOnlyUnsafeRowArray

getBufferedMatches returns the bufferedMatches.

getBufferedMatches is used when:

bufferMatchingRows

bufferMatchingRows(): Unit

bufferMatchingRows...FIXME

bufferMatchingRows is used when: