Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,11 @@ private[joins] class SortMergeAsOfJoinScanner(
var bestMatch: InternalRow = null
val iter = rightGroupBuffer.generateIterator()

// `leftRow` is fixed for this scan, so bind it once; only the right side changes per row.
joinedRow.withLeft(leftRow)
while (iter.hasNext) {
val rightRow = iter.next()
joinedRow.withLeft(leftRow).withRight(rightRow)
joinedRow.withRight(rightRow)

val asOfSatisfied = boundAsOfCond.eval(joinedRow)
if (asOfSatisfied != null && asOfSatisfied.asInstanceOf[Boolean]) {
Expand Down Expand Up @@ -418,9 +420,11 @@ private[joins] class SortMergeAsOfJoinScanner(
var bestDistance: Any = null
val iter = rightGroupBuffer.generateIterator()

// `leftRow` is fixed for this scan, so bind it once; only the right side changes per row.
joinedRow.withLeft(leftRow)
while (iter.hasNext) {
val rightRow = iter.next()
joinedRow.withLeft(leftRow).withRight(rightRow)
joinedRow.withRight(rightRow)

val asOfSatisfied = boundAsOfCond.eval(joinedRow)
if (asOfSatisfied != null && asOfSatisfied.asInstanceOf[Boolean]) {
Expand Down