[
https://issues.apache.org/jira/browse/HIVE-25861?focusedWorklogId=708869&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-708869
]
ASF GitHub Bot logged work on HIVE-25861:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 14/Jan/22 05:25
Start Date: 14/Jan/22 05:25
Worklog Time Spent: 10m
Work Description: Sirius-J closed pull request #2942:
URL: https://github.com/apache/hive/pull/2942
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 708869)
Time Spent: 20m (was: 10m)
> When ConstantPropagate optimizer optimizes case when equals case when twice,
> got wrong logical execution plan
> -------------------------------------------------------------------------------------------------------------
>
> Key: HIVE-25861
> URL: https://issues.apache.org/jira/browse/HIVE-25861
> Project: Hive
> Issue Type: Bug
> Components: Logical Optimizer
> Reporter: Jun Di
> Assignee: Jun Di
> Priority: Critical
> Labels: pull-request-available
> Attachments: 1.png, 2.png
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> when run the following sql:
> {code:sql}
> select
> t1.column_1,
> t2.column_1,
> t1.column_2,
> t1.column_3,
> case
> when (
> case
> when t1.column_1 in (310000, 320000, 330000, 340000)
> then 310000
> else t1.column_1
> end
> ) = (
> case
> when t2.column_1 in (310000, 320000, 330000, 340000)
> then 310000
> else t2.column_1
> end
> )
> then t1.column_2
> else t1.column_3
> end as result
> from
> dim.dim_xmf_center t1
> left join dim.dim_xmf_center t2
> where
> t1.mt = '202201';
> {code}
> t1.column_1 is 440000 and t2.column_1 is 440000 but the result is t1.column_3
> Please see picture 1.png in the attachment for the result
> I found that the case when part of the execution plan is wrong:
> {code:sql}
> CASE WHEN (CASE WHEN ((_col20) IN (310000, 320000, 330000, 340000)) THEN
> (CASE WHEN ((_col46) IN (310000, 320000, 330000, 340000)) THEN ((true =
> _col20)) ELSE (((_col46 = 310000) = _col20)) END) ELSE (CASE WHEN ((_col46)
> IN (310000, 320000, 330000, 340000)) THEN ((true = _col20)) ELSE (((_col46 =
> 310000) = _col20)) END) END) THEN (_col12) ELSE (_col15) END
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)