Skip to content

Commit b932caa

Browse files
committed
Address all comments
1 parent 4a35fa6 commit b932caa

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ case class ShuffledHashJoinExec(
134134
* Full outer shuffled hash join with unique join keys:
135135
* 1. Process rows from stream side by looking up hash relation.
136136
* Mark the matched rows from build side be looked up.
137-
* A [[BitSet]] is used to track matched rows with key index.
137+
* A bit set is used to track matched rows with key index.
138138
* 2. Process rows from build side by iterating hash relation.
139139
* Filter out rows from build side being matched already,
140-
* by checking key index from [[BitSet]].
140+
* by checking key index from bit set.
141141
*/
142142
private def fullOuterJoinWithUniqueKey(
143143
streamIter: Iterator[InternalRow],
@@ -149,8 +149,7 @@ case class ShuffledHashJoinExec(
149149
buildNullRow: GenericInternalRow,
150150
streamNullRow: GenericInternalRow): Iterator[InternalRow] = {
151151
val matchedKeys = new BitSet(hashedRelation.maxNumKeysIndex)
152-
val buildDataSize = longMetric("buildDataSize")
153-
buildDataSize += matchedKeys.capacity / 8
152+
longMetric("buildDataSize") += matchedKeys.capacity / 8
154153

155154
// Process stream side with looking up hash relation
156155
val streamResultIter = streamIter.map { srow =>
@@ -221,10 +220,9 @@ case class ShuffledHashJoinExec(
221220
// At the end of the task, update the task's memory usage for this
222221
// [[OpenHashSet]] to track matched rows, which has two parts:
223222
// [[OpenHashSet._bitset]] and [[OpenHashSet._data]].
224-
val buildDataSize = longMetric("buildDataSize")
225223
val bitSetEstimatedSize = matchedRows.getBitSet.capacity / 8
226224
val dataEstimatedSize = matchedRows.capacity * 8
227-
buildDataSize += bitSetEstimatedSize + dataEstimatedSize
225+
longMetric("buildDataSize") += bitSetEstimatedSize + dataEstimatedSize
228226
})
229227

230228
def markRowMatched(keyIndex: Int, valueIndex: Int): Unit = {

0 commit comments

Comments
 (0)