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

runzhiwang updated LIVY-699:
----------------------------
    Description: 
[LIVY-699][THRIFT] Fix resultSet.getBigDecimal throw java.sql.SQLException: 
Illegal conversion.

Follows are steps to reproduce the problem:
 # {{create table test(id decimal)}}.
 # Then {{resultSet.getBigDecimal(1)}} will throw:{{ java.sql.SQLException: 
Illegal conversion}}. The reason is 
{{getSchema().getColumnDescriptorAt(columnIndex - 1).getType();}} at 
[https://github.com/apache/hive/blob/master/jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java#L415]
 return string, so cannot pass the check {{val instanceof BigDecimal }}at 
[https://github.com/apache/hive/blob/master/jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java#L133],
 so throw {{java.sql.SQLException: Illegal conversion}} at 
[https://github.com/apache/hive/blob/master/jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java#L137]

Additionally, SparkThrift return decimal instead of string in the same case, so 
it is necessary to return decimal instead of string in livy. The same to 
timestamp and date.

  was:
Follows are steps to reproduce the problem:
 # {{create table test(id decimal)}}.
 # {{resultSet.getMetaData().getColumnTypeName(1)}} will return string rather 
than decimal.
 # Then {{resultSet.getBigDecimal(1)}} will throw:{{ java.sql.SQLException: 
Illegal conversion}}

Additionally, SparkThrift return decimal instead of string in the same case, so 
it is necessary to return decimal instead of string in livy. The same to 
timestamp and date.


> [LIVY-699][THRIFT] Fix resultSet.getBigDecimal throw java.sql.SQLException: 
> Illegal conversion
> ----------------------------------------------------------------------------------------------
>
>                 Key: LIVY-699
>                 URL: https://issues.apache.org/jira/browse/LIVY-699
>             Project: Livy
>          Issue Type: Bug
>    Affects Versions: 0.6.0
>            Reporter: runzhiwang
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> [LIVY-699][THRIFT] Fix resultSet.getBigDecimal throw java.sql.SQLException: 
> Illegal conversion.
> Follows are steps to reproduce the problem:
>  # {{create table test(id decimal)}}.
>  # Then {{resultSet.getBigDecimal(1)}} will throw:{{ java.sql.SQLException: 
> Illegal conversion}}. The reason is 
> {{getSchema().getColumnDescriptorAt(columnIndex - 1).getType();}} at 
> [https://github.com/apache/hive/blob/master/jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java#L415]
>  return string, so cannot pass the check {{val instanceof BigDecimal }}at 
> [https://github.com/apache/hive/blob/master/jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java#L133],
>  so throw {{java.sql.SQLException: Illegal conversion}} at 
> [https://github.com/apache/hive/blob/master/jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java#L137]
> Additionally, SparkThrift return decimal instead of string in the same case, 
> so it is necessary to return decimal instead of string in livy. The same to 
> timestamp and date.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to