AngersZhuuuu opened a new pull request #35092:
URL: https://github.com/apache/spark/pull/35092


   ### What changes were proposed in this pull request?
   Current StreamingQueryListener only support add constructor parameter of 
SparkConf, but if we  start a SparkContext first, many SQL conf won't be 
applied to SparkContext's SparkConf.
   Also it's a SQL component,  related configuration we defined it as SQLConf. 
But it's hard to use SQLConf in this plugin listener.
   
   This patch, we use pass SQLConf to `StreamingQueryManager ` and use 
`SQLConf.withExistingConf` to wrap the passed `SQLConf`. Then we can use 
`SQLConf.get` to get the same SQLConf of `SessionState` when initializing 
`StreamingQueryListener`
   
   
   
   ### Why are the changes needed?
   Pass corresponding SessionState's SQLConf to `StreamingQueryListener`. Then 
user can use SQLConf.get to use the  SQLConf.
   
   
   ### Does this PR introduce _any_ user-facing change?
   User can use `StreamingQueryListener` with corresponding `SessionState`'s 
`SQLConf`. For example
   ```
   private class SQLConfStreamingQueryListener extends StreamingQueryListener {
     val sqlConf = SQLConf.get
     override def onSuccess(funcName: String, qe: QueryExecution, durationNs: 
Long): Unit = {
     }
     override def onFailure(funcName: String, qe: QueryExecution, exception: 
Exception): Unit = {
     }
   }
   ```
   
   
   
   ### How was this patch tested?
   Added UT


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

Reply via email to