kunal642 commented on a change in pull request #3177: [CARBONDATA-3337][CARBONDATA-3306] Distributed index server URL: https://github.com/apache/carbondata/pull/3177#discussion_r278261204
########## File path: hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonInputFormat.java ########## @@ -487,62 +541,83 @@ private int getBlockCount(List<ExtendedBlocklet> blocklets) { List<ExtendedBlocklet> prunedBlocklets = null; // This is to log the event, so user will know what is happening by seeing logs. LOG.info("Started block pruning ..."); - if (carbonTable.isTransactionalTable()) { - prunedBlocklets = defaultDataMap.prune(segmentIds, resolver, partitionsToPrune); + boolean isDistributedPruningEnabled = CarbonProperties.getInstance() + .isDistributedPruningEnabled(carbonTable.getDatabaseName(), carbonTable.getTableName()); + if (isDistributedPruningEnabled) { + try { + prunedBlocklets = getDistributedSplit(carbonTable, resolver, partitionsToPrune, segmentIds, + validAndInvalidSegmentsInfo.getInvalidSegments(), null); + } catch (Exception e) { + if (CarbonProperties.getInstance().isFallBackDisabled()) { + throw e; + } + prunedBlocklets = defaultDataMap.prune(segmentIds, resolver, partitionsToPrune); + } } else { - prunedBlocklets = defaultDataMap.prune(segmentIds, expression, partitionsToPrune); - } + if (carbonTable.isTransactionalTable()) { + prunedBlocklets = defaultDataMap.prune(segmentIds, resolver, partitionsToPrune); + } else { + prunedBlocklets = defaultDataMap.prune(segmentIds, expression, partitionsToPrune); + } - if (ExplainCollector.enabled()) { - ExplainCollector.setDefaultDataMapPruningBlockHit(getBlockCount(prunedBlocklets)); - } + if (ExplainCollector.enabled()) { + ExplainCollector.setDefaultDataMapPruningBlockHit(getBlockCount(prunedBlocklets)); + } - if (prunedBlocklets.size() == 0) { - return prunedBlocklets; - } + if (prunedBlocklets.size() == 0) { 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: us...@infra.apache.org With regards, Apache Git Services