[ 
https://issues.apache.org/jira/browse/IMPALA-7960?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jim Apple updated IMPALA-7960:
------------------------------
    Labels: correctness  (was: )

> wrong results when comparing timestamp casted to varchar of smaller length to 
> a string literal in a binary predicate
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: IMPALA-7960
>                 URL: https://issues.apache.org/jira/browse/IMPALA-7960
>             Project: IMPALA
>          Issue Type: Bug
>    Affects Versions: Impala 2.12.0
>            Reporter: Bikramjeet Vig
>            Assignee: Bikramjeet Vig
>            Priority: Critical
>              Labels: correctness
>
> Expression rewriting seems to identify this as a redundant cast and removes 
> it.
> Steps to re-create:
> {noformat}
> select * from (select cast('2018-12-11 09:59:37' as timestamp) as ts) tbl 
> where cast(ts as varchar(10)) = '2018-12-11';
> {noformat}
> output:
> {noformat}
> Fetched 0 row(s) 
> {noformat}
> Now disable expression re-writes.
> {noformat}
> set ENABLE_EXPR_REWRITES=false;
> select * from (select cast('2018-12-11 09:59:37' as timestamp) as ts) tbl 
> where cast(ts as varchar(10)) = '2018-12-11';
> {noformat}
> output:
> {noformat}
> +---------------------+
> | ts                  |
> +---------------------+
> | 2018-12-11 09:59:37 |
> +---------------------+
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to