Github user xuchuanyin commented on a diff in the pull request: https://github.com/apache/carbondata/pull/2410#discussion_r199310663 --- Diff: hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonInputFormat.java --- @@ -433,46 +434,57 @@ protected Expression getFilterPredicates(Configuration configuration) { // First prune using default datamap on driver side. DataMapExprWrapper dataMapExprWrapper = DataMapChooser .getDefaultDataMap(getOrCreateCarbonTable(job.getConfiguration()), resolver); - List<ExtendedBlocklet> prunedBlocklets = + List<ExtendedBlocklet> finalPrunedBlocklets = dataMapExprWrapper.prune(segmentIds, partitionsToPrune); - ExplainCollector.recordDefaultDataMapPruning( - dataMapExprWrapper.getDataMapSchema(), prunedBlocklets.size()); + dataMapExprWrapper.getDataMapSchema(), finalPrunedBlocklets.size()); + if (finalPrunedBlocklets.size() == 0) { + return finalPrunedBlocklets; + } DataMapChooser chooser = new DataMapChooser(getOrCreateCarbonTable(job.getConfiguration())); // Get the available CG datamaps and prune further. DataMapExprWrapper cgDataMapExprWrapper = chooser.chooseCGDataMap(resolver); if (cgDataMapExprWrapper != null) { // Prune segments from already pruned blocklets - pruneSegments(segmentIds, prunedBlocklets); + pruneSegments(segmentIds, finalPrunedBlocklets); + List<ExtendedBlocklet> cgPrunedBlocklets = new ArrayList<>(); // Again prune with CG datamap. if (distributedCG && dataMapJob != null) { - prunedBlocklets = DataMapUtil + cgPrunedBlocklets = DataMapUtil .executeDataMapJob(carbonTable, resolver, segmentIds, cgDataMapExprWrapper, dataMapJob, --- End diff -- fixed
---