hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitry Tolpeko (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (HIVE-17028) Casting strings to integers in HPL/SQL differs from Hive behavior
Date Mon, 04 Sep 2017 18:32:00 GMT

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

Dmitry Tolpeko reassigned HIVE-17028:
-------------------------------------

    Assignee: Dmitry Tolpeko

> Casting strings to integers in HPL/SQL differs from Hive behavior
> -----------------------------------------------------------------
>
>                 Key: HIVE-17028
>                 URL: https://issues.apache.org/jira/browse/HIVE-17028
>             Project: Hive
>          Issue Type: Bug
>          Components: hpl/sql
>            Reporter: Carter Shanklin
>            Assignee: Dmitry Tolpeko
>
> This bug is part of a series of issues and surprising behavior I encountered writing
a reporting script that would aggregate values and give rows different classifications based
on an the aggregate. Addressing some or all of these issues would make HPL/SQL more accessible
to newcomers.
> In HPL/SQL: cast('10.0' as integer); results in:
> Unhandled exception in HPL/SQL
> java.lang.NumberFormatException: For input string: "10.0"
>         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
>         at java.lang.Long.parseLong(Long.java:589)
>         at java.lang.Long.parseLong(Long.java:631)
>         at org.apache.hive.hplsql.Var.cast(Var.java:181)
> In Hive:
> hive> select cast('10.0' as integer);
> 10
> Time taken: 4.563 seconds, Fetched: 1 row(s)
> hive> select cast('10.3' as integer);
> 10



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message