You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/08/01 00:10:00 UTC

[jira] [Work logged] (HIVE-24902) Incorrect result after fold CASE into COALESCE

     [ https://issues.apache.org/jira/browse/HIVE-24902?focusedWorklogId=632016&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-632016 ]

ASF GitHub Bot logged work on HIVE-24902:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Aug/21 00:09
            Start Date: 01/Aug/21 00:09
    Worklog Time Spent: 10m 
      Work Description: github-actions[bot] commented on pull request #2100:
URL: https://github.com/apache/hive/pull/2100#issuecomment-890420065


   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
   Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews.


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 632016)
    Time Spent: 40m  (was: 0.5h)

> Incorrect result after fold CASE into COALESCE
> ----------------------------------------------
>
>                 Key: HIVE-24902
>                 URL: https://issues.apache.org/jira/browse/HIVE-24902
>             Project: Hive
>          Issue Type: Bug
>          Components: CBO
>    Affects Versions: 3.1.2, 4.0.0
>            Reporter: Nemon Lou
>            Assignee: Nemon Lou
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> The following sql returns only one record (20210308) but expected two(20210308
> 20210309).
> {code:sql}
> select * from (
> select 
> 	case when b.a=1
> 		then  
> 			cast (from_unixtime(unix_timestamp(cast(20210309 as string),'yyyyMMdd') - 86400,'yyyyMMdd') as bigint)
> 		else 
> 			20210309 
> 	   end 
> as col
> from 
> (select stack(2,1,2) as (a))
>  as b
> ) t 
> where t.col is not null;
> {code}
> The query plan has incorrect predict: 
>  predicate: COALESCE((col0 = 1),false) (type: boolean)
> {code:sql}
> STAGE DEPENDENCIES:
>   Stage-0 is a root stage
> STAGE PLANS:
>   Stage: Stage-0
>     Fetch Operator
>       limit: -1
>       Processor Tree:
>         TableScan
>           alias: _dummy_table
>           Row Limit Per Split: 1
>           Statistics: Num rows: 1 Data size: 10 Basic stats: COMPLETE Column stats: COMPLETE
>           Select Operator
>             expressions: 2 (type: int), 1 (type: int), 2 (type: int)
>             outputColumnNames: _col0, _col1, _col2
>             Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
>             UDTF Operator
>               Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
>               function name: stack
>               Filter Operator
>                 predicate: COALESCE((col0 = 1),false) (type: boolean)
>                 Statistics: Num rows: 1 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE
>                 Select Operator
>                   expressions: CASE WHEN ((col0 = 1)) THEN (20210308L) ELSE (20210309L) END (type: bigint)
>                   outputColumnNames: _col0
>                   Statistics: Num rows: 1 Data size: 8 Basic stats: COMPLETE Column stats: COMPLETE
>                   ListSink
> Time taken: 0.155 seconds, Fetched: 28 row(s)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)