amansinha100 commented on a change in pull request #1783: DRILL-7240: Catch 
runtime pruning filter-match exceptions and do not prune these rowgroups
URL: https://github.com/apache/drill/pull/1783#discussion_r281405623
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/AbstractParquetScanBatchCreator.java
 ##########
 @@ -184,18 +185,30 @@ protected ScanBatch getBatch(ExecutorFragmentContext 
context, AbstractParquetRow
           //
           // Perform the Run-Time Pruning - i.e. Skip this rowgroup if the 
match fails
           //
-          RowsMatch match = FilterEvaluatorUtils.matches(filterPredicate, 
columnsStatistics, footerRowCount);
-
-          // collect logging info
-          long timeToRead = pruneTimer.elapsed(TimeUnit.MICROSECONDS);
-          pruneTimer.stop();
-          pruneTimer.reset();
-          totalPruneTime += timeToRead;
-          logger.trace("Run-time pruning: {} row-group {} (RG index: {} row 
count: {}), took {} usec", // trace each single rowgroup
-            match == RowsMatch.NONE ? "Excluded" : "Included", 
rowGroup.getPath(), rowGroupIndex, footerRowCount, timeToRead);
+          RowsMatch matchResult = RowsMatch.ALL;
+          try {
+            matchResult = FilterEvaluatorUtils.matches(filterPredicate, 
columnsStatistics, footerRowCount);
+
+            // collect logging info
+            long timeToRead = pruneTimer.elapsed(TimeUnit.MICROSECONDS);
+            pruneTimer.stop();
+            pruneTimer.reset();
+            totalPruneTime += timeToRead;
+            logger.trace("Run-time pruning: {} row-group {} (RG index: {} row 
count: {}), took {} usec", // trace each single rowgroup
+              matchResult == RowsMatch.NONE ? "Excluded" : "Included", 
rowGroup.getPath(), rowGroupIndex, footerRowCount, timeToRead);
+          } catch (ClassCastException cce) {
+            if ( ! matchCastErrorNotified ) {
+              logger.info("Run-time pruning check failed due to type casting. 
Skipping pruning rowgroups starting from {}. (Error: {})", rowGroup.getPath(), 
cce.getMessage());
 
 Review comment:
   Given the current behavior with non-interesting columns, there could be 
thousands of row groups which have this same ClassCastException.  It would be 
better to consolidate and generate a single INFO message. 

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


With regards,
Apache Git Services

Reply via email to