HeartSaVioR commented on code in PR #48686:
URL: https://github.com/apache/spark/pull/48686#discussion_r1827313565
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/TransformWithStateExec.scala:
##########
@@ -271,13 +271,9 @@ case class TransformWithStateExec(
ImplicitGroupingKeyTracker.setImplicitKey(keyObj)
val initStateObjIter = initStateIter.map(getInitStateValueObj.apply)
- var seenInitStateOnKey = false
initStateObjIter.foreach { initState =>
- // cannot re-initialize state on the same grouping key during initial
state handling
- if (seenInitStateOnKey) {
- throw StateStoreErrors.cannotReInitializeStateOnKey(keyObj.toString)
- }
- seenInitStateOnKey = true
+ // allow multiple initial state rows on the same grouping key for
integration
Review Comment:
Shall we describe this in handleInitialState method doc to provide the
semantic to users? After this PR, the method is called with each row, even for
the same grouping key.
--
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]