vvysotskyi commented on a change in pull request #1552:  DRILL-6865: Query 
returns wrong result when filter pruning happens
URL: https://github.com/apache/drill/pull/1552#discussion_r235997432
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetPushDownFilter.java
 ##########
 @@ -155,39 +170,53 @@ protected void doOnMatch(RelOptRuleCall call, FilterPrel 
filter, ProjectPrel pro
 
 
     Stopwatch timer = logger.isDebugEnabled() ? Stopwatch.createStarted() : 
null;
-    final GroupScan newGroupScan = 
groupScan.applyFilter(conditionExp,optimizerContext,
+    AbstractParquetGroupScan newGroupScan = 
groupScan.applyFilter(conditionExp, optimizerContext,
         optimizerContext.getFunctionRegistry(), 
optimizerContext.getPlannerSettings().getOptions());
     if (timer != null) {
       logger.debug("Took {} ms to apply filter on parquet row groups. ", 
timer.elapsed(TimeUnit.MILLISECONDS));
       timer.stop();
     }
 
-    if (newGroupScan == null ) {
+    if (newGroupScan == null) {
+      if (groupScan.isMatchAllRowGroups()) {
+        RelNode child = project == null ? scan : project;
+        // if current row group fully matches filter,
+        // but row group pruning wasn't happened, removes filter.
+        if (nonConvertedPredList.size() == 0) {
+          call.transformTo(child);
+        } else if (nonConvertedPredList.size() < predList.size()) {
 
 Review comment:
   For the case when `nonConvertedPredList.size() == predList.size()`, none of 
the predicates participated in filter pushdown, so `call.transformTo()` 
shouldn't be called for this case.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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