[ 
https://issues.apache.org/jira/browse/IMPALA-13203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17873302#comment-17873302
 ] 

Michael Smith commented on IMPALA-13203:
----------------------------------------

Here's a very simplified version of the case I ran into. I'm not sure yet why 
this particular patch fixed it. I suspect an expression rewrite moves some 
other generated construct under an 'id = 0 AND false' clause and analyzing that 
subtree happens to fix it. Prepare with  [^tables-reduced.sql], then query  
[^query-reduced.sql].

>  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: Frontend
>    Affects Versions: Impala 4.4.0
>            Reporter: Zihao Ye
>            Assignee: Zihao Ye
>            Priority: Critical
>             Fix For: Impala 4.5.0
>
>         Attachments: query-reduced.sql, tables-reduced.sql
>
>
> 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]

Reply via email to