anishshri-db commented on code in PR #36073:
URL: https://github.com/apache/spark/pull/36073#discussion_r843316289
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/SymmetricHashJoinStateManager.scala:
##########
@@ -96,6 +96,15 @@ class SymmetricHashJoinStateManager(
keyToNumValues.put(key, numExistingValues + 1)
}
+ /**
+ * Update number of values for a key.
+ * NOTE: this function is only intended for use in unit tests
+ * to simulate null values.
+ */
+ private[state] def updateNumValues(key: UnsafeRow, numValues: Long): Unit = {
Review Comment:
Done
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/SymmetricHashJoinStateManager.scala:
##########
@@ -256,6 +265,14 @@ class SymmetricHashJoinStateManager(
return null
}
+ // Find the first non-null value index starting from end
Review Comment:
Done
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/SymmetricHashJoinStateManager.scala:
##########
@@ -272,12 +289,36 @@ class SymmetricHashJoinStateManager(
if (index != numValues - 1) {
val valuePairAtMaxIndex = keyWithIndexToValue.get(currentKey,
numValues - 1)
if (valuePairAtMaxIndex != null) {
+ // likely case where last element is non-null and we can simply
swap with index
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]