You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ku...@apache.org on 2018/04/30 13:33:10 UTC

carbondata git commit: [CARBONDATA-2394] Setting segments in thread local space but was not getting reflected in the driver is fixed

Repository: carbondata
Updated Branches:
  refs/heads/master 3ea2a1dd5 -> 0f4ced9fd


[CARBONDATA-2394] Setting segments in thread local space but was not getting reflected in the driver is fixed

Problem : from multiple thread if we are setting any property to thread level. It is affecting other also.
Analysis : information in carbonSessionInfo object is being corrupted inside CarbonEnv. so if new thread may be impacted by prev one.
Solution : create a new object and in set the user specified values in thread/session params to new object.

This closes #2223


Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/0f4ced9f
Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/0f4ced9f
Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/0f4ced9f

Branch: refs/heads/master
Commit: 0f4ced9fd539be62e5eb3daccf9d1da90a34f567
Parents: 3ea2a1d
Author: rahulforallp <ra...@knoldus.in>
Authored: Tue Apr 24 18:08:41 2018 +0530
Committer: kunal642 <ku...@gmail.com>
Committed: Mon Apr 30 18:38:40 2018 +0530

----------------------------------------------------------------------
 .../src/main/scala/org/apache/spark/sql/CarbonEnv.scala      | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/0f4ced9f/integration/spark2/src/main/scala/org/apache/spark/sql/CarbonEnv.scala
----------------------------------------------------------------------
diff --git a/integration/spark2/src/main/scala/org/apache/spark/sql/CarbonEnv.scala b/integration/spark2/src/main/scala/org/apache/spark/sql/CarbonEnv.scala
index 977322b..2f23d77 100644
--- a/integration/spark2/src/main/scala/org/apache/spark/sql/CarbonEnv.scala
+++ b/integration/spark2/src/main/scala/org/apache/spark/sql/CarbonEnv.scala
@@ -91,10 +91,14 @@ class CarbonEnv {
         // update carbon session parameters , preserve thread parameters
         val currentThreadSesssionInfo = ThreadLocalSessionInfo.getCarbonSessionInfo
         carbonSessionInfo = new CarbonSessionInfo()
+        // We should not corrupt the information in carbonSessionInfo object which is at the
+        // session level. Instead create a new object and in that set the user specified values in
+        // thread/session params
+        val threadLevelCarbonSessionInfo = new CarbonSessionInfo()
         if (currentThreadSesssionInfo != null) {
-          carbonSessionInfo.setThreadParams(currentThreadSesssionInfo.getThreadParams)
+          threadLevelCarbonSessionInfo.setThreadParams(currentThreadSesssionInfo.getThreadParams)
         }
-        ThreadLocalSessionInfo.setCarbonSessionInfo(carbonSessionInfo)
+        ThreadLocalSessionInfo.setCarbonSessionInfo(threadLevelCarbonSessionInfo)
         val config = new CarbonSQLConf(sparkSession)
         if (sparkSession.conf.getOption(CarbonCommonConstants.ENABLE_UNSAFE_SORT).isEmpty) {
           config.addDefaultCarbonParams()