[
https://issues.apache.org/jira/browse/HIVE-21062?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16727828#comment-16727828
]
Zoltan Haindrich commented on HIVE-21062:
-----------------------------------------
from the explain; it seem it just trims away zeros - and packages it into the
minimal type it fits.
Could you try: 1.200?
I think you are looking for the format_number udf to specify the format
> 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)