rahulsmahadev commented on a change in pull request #33093:
URL: https://github.com/apache/spark/pull/33093#discussion_r662238905
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/FlatMapGroupsWithStateExec.scala
##########
@@ -101,51 +172,48 @@ case class FlatMapGroupsWithStateExec(
case ProcessingTimeTimeout =>
require(batchTimestampMs.nonEmpty)
case EventTimeTimeout =>
- require(eventTimeWatermark.nonEmpty) // watermark value has been
populated
+ require(eventTimeWatermark.nonEmpty) // watermark value has been
populated
require(watermarkExpression.nonEmpty) // input schema has watermark
attribute
case _ =>
}
- child.execute().mapPartitionsWithStateStore[InternalRow](
- getStateInfo,
- groupingAttributes.toStructType,
- stateManager.stateSchema,
- indexOrdinal = None,
- session.sessionState,
- Some(session.streams.stateStoreCoordinator)) { case (store, iter) =>
- val allUpdatesTimeMs = longMetric("allUpdatesTimeMs")
- val commitTimeMs = longMetric("commitTimeMs")
- val updatesStartTimeNs = System.nanoTime
+ if (hasInitialState) {
+ // If the user provided initial state we need to have the initial state
and the
+ // data in the same partition so that we can still have just one commit
at the end.
+ val storeConf = new StateStoreConf(session.sqlContext.sessionState.conf)
+ val hadoopConfBroadcast = sparkContext.broadcast(
+ new
SerializableConfiguration(session.sqlContext.sessionState.newHadoopConf()))
+ child.execute().stateStoreAwareZipPartitions(
+ initialState.execute(),
+ getStateInfo,
+ storeNames = Seq(),
Review comment:
hmm It uses that by default
https://livegrep.dev.databricks.com/view/databricks/runtime/sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/StateStore.scala#L385
The only test I found was
https://livegrep.dev.databricks.com/view/databricks/runtime/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingJoinSuite.scala#L513
not sure how we can use that for this scenario
--
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]