AngersZhuuuu commented on a change in pull request #26187: [SPARK-29530][SQL] 
Reset active SparkSession before parse sql in SparkSession
URL: https://github.com/apache/spark/pull/26187#discussion_r336877350
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala
 ##########
 @@ -600,6 +600,7 @@ class SparkSession private(
    * @since 2.0.0
    */
   def sql(sqlText: String): DataFrame = {
+    SparkSession.setActiveSession(this)
     val tracker = new QueryPlanningTracker
     val plan = tracker.measurePhase(QueryPlanningTracker.PARSING) {
       sessionState.sqlParser.parsePlan(sqlText)
 
 Review comment:
   > I know that we use `SQLConf.get` a lot in analyzer/optimizer rules, but 
does it also true for the parser?
   
   Parser use `SQLConf.get` too.
   It truly make some  configuration about parser mess in SparkThriftServer 
multi thread mode.
   

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