You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "WweiL (via GitHub)" <gi...@apache.org> on 2023/04/25 22:26:28 UTC
[GitHub] [spark] WweiL commented on a diff in pull request #40937: [SPARK-42940] Improve session management for streaming queries
WweiL commented on code in PR #40937:
URL: https://github.com/apache/spark/pull/40937#discussion_r1177124740
##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectPlanner.scala:
##########
@@ -2092,6 +2097,11 @@ class SparkConnectPlanner(val session: SparkSession) {
case path => writer.start(path)
}
+ // Register the new query so that the session and query references are cached.
+ SparkConnectService.streamingSessionManager.registerNewStreamingQuery(
Review Comment:
If the query throws before this line. What would happen? I would think the `orElse` would be triggered:
```
val query = SparkConnectService.streamingSessionManager
.findCachedQuery(id, session) // Common case: query is cached in connect session manager.
.orElse { // Else try to find it in active streams. Mostly will not be found here.
Option(session.streams.get(id))
```
And that'd still return a query ID not found exception?
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org