[GitHub] qiuchenjian commented on a change in pull request #3095: [CARBONDATA-3265] Fixed memory Leak and Query performance issue in Range Partition

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] qiuchenjian commented on a change in pull request #3095: [CARBONDATA-3265] Fixed memory Leak and Query performance issue in Range Partition

GitBox
qiuchenjian commented on a change in pull request #3095: [CARBONDATA-3265] Fixed memory Leak and Query performance issue in Range Partition
URL: https://github.com/apache/carbondata/pull/3095#discussion_r250065026
 
 

 ##########
 File path: integration/spark-common/src/main/scala/org/apache/carbondata/spark/load/DataLoadProcessBuilderOnSpark.scala
 ##########
 @@ -127,9 +130,32 @@ object DataLoadProcessBuilderOnSpark {
       }
 
     // 4. Write
-    sc.runJob(sortRDD, (context: TaskContext, rows: Iterator[CarbonRow]) =>
+    sc.runJob(sortRDD, (context: TaskContext, rows: Iterator[CarbonRow]) => {
+      TaskContext.get.addTaskCompletionListener(_ => ThreadLocalSessionInfo.unsetAll())
+      val carbonSessionInfo: CarbonSessionInfo = {
+        var info = ThreadLocalSessionInfo.getCarbonSessionInfo
+        if (info == null || null == info.getSessionParams) {
 
 Review comment:
   if info != null ,no need to generate a new object

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services