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

Ashutosh Chauhan commented on HIVE-8555:
----------------------------------------

This patch remembers string representation of constant of any type. So, source 
type can be anything, but  target type needs to be string when cast is 
happening. AFAICT, this problem of change of representation can only  happen 
when target is string, but I havent tested other types. If it turns out change 
of representation happens for other type, we can address them in subsequent 
jiras.

> Too many casts results in loss of original string representation for constant 
> ------------------------------------------------------------------------------
>
>                 Key: HIVE-8555
>                 URL: https://issues.apache.org/jira/browse/HIVE-8555
>             Project: Hive
>          Issue Type: Bug
>          Components: Logical Optimizer
>    Affects Versions: 0.14.0
>            Reporter: Ashutosh Chauhan
>            Assignee: Ashutosh Chauhan
>         Attachments: HIVE-8555.patch
>
>
> {code}
> SELECT key, value FROM src WHERE key = cast(86 as double);
> 86.0  val_86
> {code}
> With constant propagate off we get different and correct result.
> {code}
> set hive.optimize.constant.propagation=false;
> SELECT key, value FROM src WHERE key =  cast(86 as double);
> 86  val_86
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to