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

Gyorgy Gal updated LIVY-771:
----------------------------
    Fix Version/s: 0.10.0
                       (was: 0.9.0)

This issue has been moved to the 0.10.0 release as part of a bulk update. If 
you feel this is moved out inappropriately, feel free to provide justification 
and reset the Fix Version to 0.9.0.

> Thrift server returns decimal value with trailing zeros removed
> ---------------------------------------------------------------
>
>                 Key: LIVY-771
>                 URL: https://issues.apache.org/jira/browse/LIVY-771
>             Project: Livy
>          Issue Type: Bug
>          Components: Thriftserver
>    Affects Versions: 0.6.0, 0.7.0
>            Reporter: Wing Yew Poon
>            Priority: Major
>             Fix For: 0.10.0
>
>          Time Spent: 6.5h
>  Remaining Estimate: 0h
>
> I have been doing some Hive interop testing. I have a Hive table with a 
> column, f_decimal decimal(5, 2). 
> I run a query to select f_decimal from the table. I run this in Hive (HS2) 
> through beeline, as well as in the Livy Thrift server through beeline. In the 
> case of Hive, the decimal values are shown with the correct scale (2 places 
> to the right of the decimal point) in all cases, while in the case of the 
> Livy TS, the decimal values that have trailing zeros are shown with trailing 
> zeros removed. E.g., 9.40 in Hive vs 9.4 in Livy; 713.00 in Hive vs 713 in 
> Livy. (I did not actually have this in my table, but 120.00 in Hive would be 
> 1.2E+2 in Livy.)
> E.g.,
> beeline to HS2:
> {noformat}
> > select f_decimal from hive_types_test order by f_int limit 1;
> +------------+
> | f_decimal  |
> +------------+
> | 9.40       |
> +------------+
> 1 row selected (14.31 seconds)
> {noformat}
> beeline to Livy TS:
> {noformat}
> > select f_decimal from hive_types_test order by f_int limit 1;
> +------------+
> | f_decimal  |
> +------------+
> | 9.4        |
> +------------+
> 1 row selected (11.544 seconds)
> {noformat}
> If the column type is decimal(5, 2), then the values should be shown with the 
> correct scale. Also, the results should, where possible, be the same in Livy 
> as in Hive.
> However, this is not merely a display issue. It manifests at the JDBC level. 
> If you connect to the Livy Thrift server using JDBC, execute a query and get 
> a java.sql.ResultSet, then ResultSet#getBigDecimal on the index of a column 
> of decimal type returns a BigDecimal value of incorrect scale in the above 
> case.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to