[
https://issues.apache.org/jira/browse/IMPALA-13203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17864737#comment-17864737
]
ASF subversion and git services commented on IMPALA-13203:
----------------------------------------------------------
Commit 018f5980884fcf34f78ee3898b06531c05826c8a in impala's branch
refs/heads/master from Eyizoha
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=018f59808 ]
IMPALA-13203: Rewrite 'id = 0 OR false' as expected
Currently, ExprRewriter cannot rewrite 'id = 0 OR false' to 'id = 0' as
expected. More precisely, it fails to rewrite any cases where a boolean
literal follows 'AND/OR' as expected.
The issue is that the CompoundPredicate generated by NormalizeExprsRule
is not analyzed, causing SimplifyConditionalsRule to skip the rewrite.
This patch fixes the issue by adding analysis of the rewritten
CompoundPredicate in NormalizeExprsRule.
Testing:
- Modified and passed FE test case
ExprRewriteRulesTest#testCompoundPredicate
- Modified and passed related test case
Change-Id: I9d9fffdd1cc644cc2b48f08c2509f22a72362d22
Reviewed-on: http://gerrit.cloudera.org:8080/21568
Reviewed-by: Csaba Ringhofer <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
> ExprRewriter did not rewrite 'id = 0 OR false' as expected
> -----------------------------------------------------------
>
> Key: IMPALA-13203
> URL: https://issues.apache.org/jira/browse/IMPALA-13203
> Project: IMPALA
> Issue Type: Bug
> Components: fe
> Affects Versions: Impala 4.4.0
> Reporter: Zihao Ye
> Assignee: Zihao Ye
> Priority: Minor
>
> The comments in the SimplifyConditionalsRule class mention that 'id = 0 OR
> false' would be rewritten to 'id = 0', but in reality, it does not perform
> this rewrite as expected. After executing such SQL, we can see in the text
> plan that:
> {code:sql}
> Analyzed query: SELECT * FROM functional.alltypestiny WHERE FALSE OR id =
> CAST(0
> AS INT) {code}
> The issue appears to be that the CompoundPredicate generated by
> NormalizeExprsRule was not analyzed, causing the SimplifyConditionalsRule to
> skip the rewrite.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]