HeartSaVioR commented on a change in pull request #29767:
URL: https://github.com/apache/spark/pull/29767#discussion_r501479016
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/streaming/DataStreamWriter.scala
##########
@@ -380,19 +396,31 @@ final class DataStreamWriter[T] private[sql](ds:
Dataset[T]) {
createV1Sink(optionsWithPath)
}
- df.sparkSession.sessionState.streamingQueryManager.startQuery(
- extraOptions.get("queryName"),
- extraOptions.get("checkpointLocation"),
- df,
- optionsWithPath.originalMap,
- sink,
- outputMode,
- useTempCheckpointLocation = source == "console" || source == "noop",
- recoverFromCheckpointLocation = true,
- trigger = trigger)
+ startQuery(sink, optionsWithPath)
}
}
+ private def startQuery(
+ sink: Table,
+ newOptions: CaseInsensitiveMap[String],
+ recoverFromCheckpoint: Boolean = true): StreamingQuery = {
+ val options = newOptions.originalMap
+ val queryName = options.get("queryName")
+ val checkpointLocation = options.get("checkpointLocation")
+ val useTempCheckpointLocation =
SOURCES_ALLOW_ONE_TIME_QUERY.contains(source)
+
+ df.sparkSession.sessionState.streamingQueryManager.startQuery(
Review comment:
OK let me keep it as it is.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]