[
https://issues.apache.org/jira/browse/HIVE-14863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15549810#comment-15549810
]
Matt McCline commented on HIVE-14863:
-------------------------------------
Consider moving the vectorization conversions methods out of HiveDecimal so it
isn't attached to the ColumnVector types.
Have you verified the concern "can we fail SARG?". Does it pass the failed row
up?
In PrimitiveObjectInspectorUtils.java:
{code}
try {
result = hd.intValue();
} catch (ArithmeticException ex) {
throw new NumberFormatException("Can't convert " + hd + " to int");
}
{code}
doesn't intValue need to be intValueExact?
Are we sure we want to be throwing exceptions for int and long conversion
issues here?
Not sure where you and Jason are on the Q file test.
> Decimal to int conversion produces incorrect values
> ---------------------------------------------------
>
> Key: HIVE-14863
> URL: https://issues.apache.org/jira/browse/HIVE-14863
> Project: Hive
> Issue Type: Bug
> Reporter: Sergey Shelukhin
> Assignee: Sergey Shelukhin
> Priority: Critical
> Attachments: HIVE-14863.01.patch, HIVE-14863.patch
>
>
> {noformat}
> > select cast(cast ('111111111111111' as decimal(38,0)) as int);
> OK
> 307163591
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)