dongjoon-hyun commented on a change in pull request #26018: 
[SPARK-29352][SQL][SS] Track active streaming queries in the 
SparkSession.sharedState
URL: https://github.com/apache/spark/pull/26018#discussion_r334257813
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/streaming/StreamingQueryManager.scala
 ##########
 @@ -352,8 +352,10 @@ class StreamingQueryManager private[sql] (sparkSession: 
SparkSession) extends Lo
         }
       }
 
-      // Make sure no other query with same id is active
-      if (activeQueries.values.exists(_.id == query.id)) {
+      // Make sure no other query with same id is active across all sessions
+      val activeOption =
+        
Option(sparkSession.sharedState.activeStreamingQueries.putIfAbsent(query.id, 
this))
+      if (activeOption.isDefined || activeQueries.values.exists(_.id == 
query.id) {
 
 Review comment:
   It seems that one `)` is missed after `query.id)`.
   ```
   [error] 
/home/jenkins/workspace/SparkPullRequestBuilder@2/sql/core/src/main/scala/org/apache/spark/sql/streaming/StreamingQueryManager.scala:
 Expected token RPAREN but got Token(DOT,.,14050,.)
   [error] Total time: 20 s, completed Oct 12, 2019 4:11:49 PM
   ```

----------------------------------------------------------------
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]

Reply via email to