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_r235994435
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/AbstractParquetGroupScan.java
##########
@@ -262,41 +273,31 @@ public GroupScan applyFilter(LogicalExpression
filterExpr, UdfUtilities udfUtili
Map<SchemaPath, ColumnStatistics> columnStatisticsMap =
statCollector.collectColStat(schemaPathsInExpr);
- if (filterPredicate == null) {
- ErrorCollector errorCollector = new ErrorCollectorImpl();
- LogicalExpression materializedFilter =
ExpressionTreeMaterializer.materializeFilterExpr(
- filterExpr, columnStatisticsMap, errorCollector,
functionImplementationRegistry);
-
- if (errorCollector.hasErrors()) {
- logger.error("{} error(s) encountered when materialize filter
expression : {}",
- errorCollector.getErrorCount(), errorCollector.toErrorString());
- return null;
- }
- logger.debug("materializedFilter : {}",
ExpressionStringBuilder.toString(materializedFilter));
-
- Set<LogicalExpression> constantBoundaries =
ConstantExpressionIdentifier.getConstantExpressionSet(materializedFilter);
- filterPredicate =
ParquetFilterBuilder.buildParquetFilterPredicate(materializedFilter,
constantBoundaries, udfUtilities);
-
- if (filterPredicate == null) {
- return null;
- }
- }
-
- ParquetFilterPredicate.RowsMatch match =
ParquetRGFilterEvaluator.matches(filterPredicate, columnStatisticsMap,
rowGroup.getRowCount(), parquetTableMetadata, rowGroup.getColumns(),
schemaPathsInExpr);
+ ParquetFilterPredicate.RowsMatch match =
ParquetRGFilterEvaluator.matches(filterPredicate,
+ columnStatisticsMap, rowGroup.getRowCount(), parquetTableMetadata,
rowGroup.getColumns(), schemaPathsInExpr);
if (match == ParquetFilterPredicate.RowsMatch.NONE) {
continue; // No row comply to the filter => drop the row group
}
- rowGroup.setRowsMatch(match);
+ if (matchAllRowGroupsLocal) {
Review comment:
Thanks, done
----------------------------------------------------------------
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