Skip to content

Commit cf04e2f

Browse files
committed
Address all new comments
1 parent 82ed0b4 commit cf04e2f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashedRelation.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ private[execution] sealed trait HashedRelation extends KnownSizeEstimation {
7575

7676
/**
7777
* Returns key index and matched single row.
78+
* This is for unique key case.
7879
*
7980
* Returns null if there is no matched rows.
8081
*/

sql/core/src/main/scala/org/apache/spark/sql/execution/joins/ShuffledHashJoinExec.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ case class ShuffledHashJoinExec(
193193
}
194194

195195
/**
196-
* Full outer shuffled hash join with unique join keys:
196+
* Full outer shuffled hash join with non-unique join keys:
197197
* 1. Process rows from stream side by looking up hash relation.
198198
* Mark the matched rows from build side be looked up.
199199
* A `HashSet[Long]` is used to track matched rows with
@@ -253,9 +253,11 @@ case class ShuffledHashJoinExec(
253253
}
254254
// When we reach here, it means no match is found for this key.
255255
// So we need to return one row with build side NULL row,
256-
// to match the full outer join semantic.
256+
// to satisfy the full outer join semantic.
257257
if (!found) {
258258
joinRowWithBuild(buildNullRow)
259+
// Set `found` to be true as we only need to return one row
260+
// but no more.
259261
found = true
260262
return true
261263
}

0 commit comments

Comments
 (0)