Ngone51 commented on pull request #31600:
URL: https://github.com/apache/spark/pull/31600#issuecomment-783001883


   > Just wondering, does anyone know the reason the code uses both 
sparkSession and sparkSessionForStream? Are there any known conditions when we 
should still use sparkSession and when we should use sparkSessionForStream 
instead?
   
   
   That's a good question. After taking another look, IIUC, I think 
`sparkSessionForStream`  is used for  `runActivatedStream()` only and 
`sparkSession` is used for everything  out of `runActivatedStream()`.  Thus, I 
think the better fix should be:
   
   ```scala
   sparkSessionForStream.withActive {
    ...
    runActivatedStream(sparkSessionForStream)
    ...
   }
   ```
   
   What do you guys think?
   
   


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

Reply via email to