HeartSaVioR commented on a change in pull request #26108: [SPARK-26154][SS]
Streaming left/right outer join should not return outer nulls for already
matched rows
URL: https://github.com/apache/spark/pull/26108#discussion_r334352946
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/SymmetricHashJoinStateManager.scala
##########
@@ -380,18 +412,85 @@ class SymmetricHashJoinStateManager(
* Helper class for representing data returned by
[[KeyWithIndexToValueStore]].
* Designed for object reuse.
*/
- private case class KeyWithIndexAndValue(
- var key: UnsafeRow = null, var valueIndex: Long = -1, var value: UnsafeRow
= null) {
- def withNew(newKey: UnsafeRow, newIndex: Long, newValue: UnsafeRow):
this.type = {
+ private class KeyWithIndexAndValueWithMatched(
+ var key: UnsafeRow = null,
+ var valueIndex: Long = -1,
+ var value: UnsafeRow = null,
+ var matched: Boolean = false) {
+ def withNew(
+ newKey: UnsafeRow,
+ newIndex: Long,
+ newValue: UnsafeRow,
+ newMatched: Boolean): this.type = {
this.key = newKey
this.valueIndex = newIndex
this.value = newValue
+ this.matched = newMatched
this
}
}
- /** A wrapper around a [[StateStore]] that stores [(key, index) -> value]. */
- private class KeyWithIndexToValueStore extends
StateStoreHandler(KeyWithIndexToValueType) {
+ private trait KeyWithIndexToValueRowConverter {
Review comment:
This is unavoidable refactoring, as we need to deal with both schemas
depending on the state format version.
I didn't let inner join use state format version 1 (though it could be one
of optimizations), as the query could be changed to outer join which Spark will
not be able to determine the change - correctness issue will occur then.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]