Uploaded image for project: 'Livy'
  1. Livy
  2. LIVY-699

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.6.0
    • 0.7.0
    • None
    • None

    Description

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

      Follows are steps to reproduce the problem:

      1. create table test(id decimal).
      2. 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.

      Attachments

        Issue Links

          Activity

            People

              runzhiwang Jie Wang
              runzhiwang Jie Wang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m