You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Ravi Shetye (JIRA)" <ji...@apache.org> on 2018/12/20 18:27:00 UTC

[jira] [Updated] (HIVE-21062) Hive 2.X auto converts a round decimal to integer

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

Ravi Shetye updated HIVE-21062:
-------------------------------
    Summary: Hive 2.X auto converts a round decimal to integer  (was: Hive 3.0 auto converts a round decimal to integer)

> Hive 2.X auto converts a round decimal to integer
> -------------------------------------------------
>
>                 Key: HIVE-21062
>                 URL: https://issues.apache.org/jira/browse/HIVE-21062
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Processor
>    Affects Versions: 2.3.4
>            Reporter: Ravi Shetye
>            Priority: Major
>
> {noformat}
> 0: jdbc:hive2://localhost:10000> select 1.0 ;
> +------+
> | _c0  |
> +------+
> | 1    |
> +------+
> {noformat}
> It happens with parameters to functions as well
> {code:java}
> 0: jdbc:hive2://localhost:10000> select CONCAT("hi",1.0) ;
> +------+
> | _c0  |
> +------+
> | hi1  |
> +------+
> {code}
> Hive reads 1.0 as decimal(1,0), and then may be is converting it to int ?
> {code:java}
> 0: jdbc:hive2://localhost:10000> EXPLAIN EXTENDED select 1.0;
> +--------------------------------------------------+
> |                     Explain                      |
> +--------------------------------------------------+
> | 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                 |
> |           GatherStats: false                     |
> |           Select Operator                        |
> |             expressions: 1 (type: decimal(1,0))  |
> |             outputColumnNames: _col0             |
> |             ListSink                             |
> |                                                  |
> +--------------------------------------------------+
> {code}



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