File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
sql/core/src/main/scala/org/apache/spark/sql/execution/joins Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -1631,15 +1631,19 @@ private class SortMergeFullOuterJoinScanner(
16311631 advancedRight()
16321632 true
16331633 } else if (leftRow != null && rightRow != null ) {
1634- // Both rows are present and neither have null values,
1635- // so we populate the buffers with rows matching the next key
1634+ // Both rows are present and neither have null values.
16361635 val comp = keyOrdering.compare(leftRowKey, rightRowKey)
1637- if (comp <= 0 ) {
1638- findMatchingRows(leftRowKey.copy())
1636+ if (comp < 0 ) {
1637+ joinedRow(leftRow.copy(), rightNullRow)
1638+ advancedLeft()
1639+ } else if (comp > 0 ) {
1640+ joinedRow(leftNullRow, rightRow.copy())
1641+ advancedRight()
16391642 } else {
1640- findMatchingRows(rightRowKey.copy())
1643+ // Populate the buffers with rows matching the next key.
1644+ findMatchingRows(leftRowKey.copy())
1645+ scanNextInBuffered()
16411646 }
1642- scanNextInBuffered()
16431647 true
16441648 } else {
16451649 // Both iterators have been consumed
You can’t perform that action at this time.
0 commit comments