[GitHub] [carbondata] ajantha-bhat commented on a change in pull request #3254: [CARBONDATA-3411] Fix clear datamaps logs an exception in SDK

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

[GitHub] [carbondata] ajantha-bhat commented on a change in pull request #3254: [CARBONDATA-3411] Fix clear datamaps logs an exception in SDK

GitBox
ajantha-bhat commented on a change in pull request #3254: [CARBONDATA-3411] Fix clear datamaps logs an exception in SDK
URL: https://github.com/apache/carbondata/pull/3254#discussion_r290572277
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/datamap/DataMapStoreManager.java
 ##########
 @@ -511,44 +511,41 @@ public void clearDataMaps(AbsoluteTableIdentifier identifier) {
    */
   public void clearDataMaps(AbsoluteTableIdentifier identifier, boolean launchJob) {
     String tableUniqueName = identifier.getCarbonTableIdentifier().getTableUniqueName();
-    CarbonTable carbonTable = getCarbonTable(identifier);
-    if (launchJob && CarbonProperties.getInstance()
-        .isDistributedPruningEnabled(identifier.getDatabaseName(), identifier.getTableName())) {
+    if (launchJob) {
+      String jobClassName;
+      if (CarbonProperties.getInstance()
+          .isDistributedPruningEnabled(identifier.getDatabaseName(), identifier.getTableName())) {
+        jobClassName = DataMapUtil.DISTRIBUTED_JOB_NAME;
+      } else {
+        jobClassName = DataMapUtil.EMBEDDED_JOB_NAME;
+      }
+      // carbon table need to lookup only if launch job is set.
+      CarbonTable carbonTable = getCarbonTable(identifier);
       if (null != carbonTable) {
         try {
-          DataMapUtil.executeClearDataMapJob(carbonTable, DataMapUtil.DISTRIBUTED_JOB_NAME);
+          DataMapUtil.executeClearDataMapJob(carbonTable, jobClassName);
 
 Review comment:
   done

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services