Joe McDonnell has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/15371 )
Change subject: IMPALA-9429: Unioned partition columns break partition pruning ...................................................................... IMPALA-9429: Unioned partition columns break partition pruning In the case of a union query where predicates are pushed into the union, predicate Exprs can contain SlotReft that are transformed into constants after analysis and eligible for constant folding. During partition pruning there is a check that eligible constant folding has already occurred which was failing and reporting IllegalStateException since the surrounding code only handles specific cases. This fix adds FoldConstantsRule to the rewriter used by HdfsPartitionPruner.prunePartitions so that pruning predicates have any constants folded as expected. Testing: Testcases added to PlannerTest/union.test based on provided repo using alltypes tables. Change-Id: I1c1384c2cd1ad5f7024449196f9a348ecdccb60b Reviewed-on: http://gerrit.cloudera.org:8080/15371 Reviewed-by: Quanlong Huang <[email protected]> Reviewed-by: Joe McDonnell <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> --- M fe/src/main/java/org/apache/impala/planner/HdfsPartitionPruner.java M testdata/workloads/functional-planner/queries/PlannerTest/union.test 2 files changed, 176 insertions(+), 5 deletions(-) Approvals: Quanlong Huang: Looks good to me, but someone else must approve Joe McDonnell: Looks good to me, approved Impala Public Jenkins: Verified -- To view, visit http://gerrit.cloudera.org:8080/15371 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I1c1384c2cd1ad5f7024449196f9a348ecdccb60b Gerrit-Change-Number: 15371 Gerrit-PatchSet: 5 Gerrit-Owner: Kurt Deschler <[email protected]> Gerrit-Reviewer: Anurag Mantripragada <[email protected]> Gerrit-Reviewer: Bharath Vissapragada <[email protected]> Gerrit-Reviewer: Fredy Wijaya <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Joe McDonnell <[email protected]> Gerrit-Reviewer: Kurt Deschler <[email protected]> Gerrit-Reviewer: Quanlong Huang <[email protected]> Gerrit-Reviewer: Vihang Karajgaonkar <[email protected]>
