Github user kumarvishal09 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2057#discussion_r174682778
--- Diff:
integration/spark2/src/main/scala/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala
---
@@ -52,9 +52,12 @@ class CarbonSparkSqlParser(conf: SQLConf, sparkSession:
SparkSession) extends Ab
override def parsePlan(sqlText: String): LogicalPlan = {
CarbonSession.updateSessionInfoToCurrentThread(sparkSession)
try {
- super.parsePlan(sqlText)
+ val parsedPlan = super.parsePlan(sqlText)
+ CarbonScalaUtil.cleanParserThreadLocals
--- End diff --
In case of exception it is calling CarbonSpark2SqlParser.parse which is
already handling clearing thread local object so we cannot handle in finally
---