-
Notifications
You must be signed in to change notification settings - Fork 980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DRILL-6865: Query returns wrong result when filter pruning happens #1552
Conversation
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did not happen, remove the filter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, changed.
@@ -85,6 +85,8 @@ | |||
|
|||
private List<EndpointAffinity> endpointAffinities; | |||
private ParquetGroupScanStatistics parquetGroupScanStatistics; | |||
// whether all row groups of this group scan fully matches the filter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fully match
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetPushDownFilter.java
Show resolved
Hide resolved
// but row group pruning wasn't happened, removes filter. | ||
if (nonConvertedPredList.size() == 0) { | ||
call.transformTo(child); | ||
} else if (nonConvertedPredList.size() < predList.size()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't be else enough? Why check that non converted list is smaller?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This clear, my concern was second condition } else if (nonConvertedPredList.size() < predList.size())
. Why we cannot use else
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, else
will include both nonConvertedPredList.size() < predList.size()
and nonConvertedPredList.size() == predList.size()
cases, but as I pointed in the comment above, we shouldn't do anything for the last case.
@@ -63,6 +63,7 @@ | |||
static final Logger logger = LoggerFactory.getLogger(ParquetFilterBuilder.class); | |||
|
|||
private final UdfUtilities udfUtilities; | |||
private final boolean omitUnsupportedExprs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add javadoc explaining cases when we want to omit unsupported expressions and when we don't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please describe cases when we need this flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added to its Javadoc case when it should be used.
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/AbstractParquetGroupScan.java
Show resolved
Hide resolved
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/AbstractParquetGroupScan.java
Show resolved
Hide resolved
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/AbstractParquetGroupScan.java
Show resolved
Hide resolved
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFilterBuilder.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arina-ielchiieva, thanks for the review, I have addressed your comments, could you please take a look again?
@@ -85,6 +85,8 @@ | |||
|
|||
private List<EndpointAffinity> endpointAffinities; | |||
private ParquetGroupScanStatistics parquetGroupScanStatistics; | |||
// whether all row groups of this group scan fully matches the filter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/AbstractParquetGroupScan.java
Show resolved
Hide resolved
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/AbstractParquetGroupScan.java
Show resolved
Hide resolved
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/AbstractParquetGroupScan.java
Show resolved
Hide resolved
@@ -63,6 +63,7 @@ | |||
static final Logger logger = LoggerFactory.getLogger(ParquetFilterBuilder.class); | |||
|
|||
private final UdfUtilities udfUtilities; | |||
private final boolean omitUnsupportedExprs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, added.
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetPushDownFilter.java
Show resolved
Hide resolved
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, changed.
// but row group pruning wasn't happened, removes filter. | ||
if (nonConvertedPredList.size() == 0) { | ||
call.transformTo(child); | ||
} else if (nonConvertedPredList.size() < predList.size()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetFilterBuilder.java
Show resolved
Hide resolved
c38ec34
to
3939d2f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@arina-ielchiieva, I have made required changes, could you please take a look?
// but row group pruning wasn't happened, removes filter. | ||
if (nonConvertedPredList.size() == 0) { | ||
call.transformTo(child); | ||
} else if (nonConvertedPredList.size() < predList.size()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, else
will include both nonConvertedPredList.size() < predList.size()
and nonConvertedPredList.size() == predList.size()
cases, but as I pointed in the comment above, we shouldn't do anything for the last case.
@@ -63,6 +63,7 @@ | |||
static final Logger logger = LoggerFactory.getLogger(ParquetFilterBuilder.class); | |||
|
|||
private final UdfUtilities udfUtilities; | |||
private final boolean omitUnsupportedExprs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added to its Javadoc case when it should be used.
451130a
to
747151f
Compare
+1, LGTM. |
…lly matches the filter closes apache#1552
…lly matches the filter closes apache#1552
…lly matches the filter closes apache#1552
This PR contains two commits:
For problem descriptions please see DRILL-6865.