kevinjmh commented on a change in pull request #3369: [CARBONDATA-3508] Support 
CG datamap pruning fallback while querying
URL: https://github.com/apache/carbondata/pull/3369#discussion_r319370652
 
 

 ##########
 File path: 
hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonInputFormat.java
 ##########
 @@ -573,19 +573,27 @@ private int getBlockCount(List<ExtendedBlocklet> 
blocklets) {
       if (cgDataMapExprWrapper != null) {
         // Prune segments from already pruned blocklets
         DataMapUtil.pruneSegments(segmentIds, prunedBlocklets);
-        List<ExtendedBlocklet> cgPrunedBlocklets;
+        List<ExtendedBlocklet> cgPrunedBlocklets = new ArrayList<>();
         // Again prune with CG datamap.
         if (distributedCG && dataMapJob != null) {
-          cgPrunedBlocklets = DataMapUtil
-              .executeDataMapJob(carbonTable, filter.getResolver(), 
dataMapJob, partitionsToPrune,
-                  segmentIds, invalidSegments, DataMapLevel.CG, true, new 
ArrayList<String>());
+          try {
+            cgPrunedBlocklets = DataMapUtil
+                .executeDataMapJob(carbonTable, filter.getResolver(), 
dataMapJob, partitionsToPrune,
+                    segmentIds, invalidSegments, DataMapLevel.CG, true, new 
ArrayList<String>());
+          } catch (Exception e) {
+            LOG.error("CG datamap pruning failed.", e);
+          }
         } else {
           cgPrunedBlocklets = cgDataMapExprWrapper.prune(segmentIds, 
partitionsToPrune);
         }
-        // since index datamap prune in segment scope,
-        // the result need to intersect with previous pruned result
-        prunedBlocklets =
-            intersectFilteredBlocklets(carbonTable, prunedBlocklets, 
cgPrunedBlocklets);
+        // If cgPrunedBlocklets == 0, it means that CG datamap pruning failed,
 
 Review comment:
   For case 2, let's say some blocklet has a column with data lying as 
`1,3,5,7,9` and its min max value are 1 and 9.  If here comes a filter `col=2`, 
the default datamap found 2 is between 1 and 9, and take this blocklet to scan. 
Then it goes to cg pruning, it cound be found that value 2 does not exist in 
blocklet using hash by bloom datamap. 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to