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

Michael Smith commented on IMPALA-12164:
----------------------------------------

Alright, analyzing everything even if they're going to be removed used to mask 
cases where ExprRewriteRules didn't analyze the new predicates they created. So 
this patch now causes any of those that modify the expression (but don't 
analyze it) in a way that will result in reducing the number of conjuncts on 
re-analysis (usually because the expression will end up evaluating to false) to 
re-use Expr IDs and cause new expressions to not materialize their slots.

I can go through on a case-by-case basis and fix up the ExprRewriteRules, or 
modify registerConjuncts to continue analyzing all conjuncts before marking 
them assigned. I plan to add a Precondition to detect this earlier when we do 
run into possible conflicts (if we try to markConjunctAssigned a conjunct that 
wasn't registered with the current analyzer), but that will only detect them if 
we test the relevant query.

> The query fails with "IllegalStateException: Illegal reference to 
> non-materialized slot: tid=x sid=x"
> -----------------------------------------------------------------------------------------------------
>
>                 Key: IMPALA-12164
>                 URL: https://issues.apache.org/jira/browse/IMPALA-12164
>             Project: IMPALA
>          Issue Type: Bug
>    Affects Versions: Impala 4.1.2
>            Reporter: Zhi Tang
>            Assignee: Zhi Tang
>            Priority: Major
>             Fix For: Impala 4.3.0
>
>         Attachments: image-2023-05-25-14-26-43-507.png
>
>
> The query failed in the compile execution plan phase. The stacktrace in logs:
> !image-2023-05-25-14-26-43-507.png|width=564,height=211!



--
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