hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukas Eder (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-4499) Implement more versatile data type conversion in Hive JDBC ResultSet
Date Tue, 07 May 2013 11:13:16 GMT

    [ https://issues.apache.org/jira/browse/HIVE-4499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13650723#comment-13650723
] 

Lukas Eder commented on HIVE-4499:
----------------------------------

Sure, I'm just giving in hints, myself. The last word should be said by the Hive people, of
course. I was hinting at an implementation like this one here, which is "conversion-complete":

https://code.google.com/p/h2database/source/browse/trunk/h2/src/main/org/h2/jdbc/JdbcResultSet.java

I'm sure you can find some more inspiration there.
                
> Implement more versatile data type conversion in Hive JDBC ResultSet
> --------------------------------------------------------------------
>
>                 Key: HIVE-4499
>                 URL: https://issues.apache.org/jira/browse/HIVE-4499
>             Project: Hive
>          Issue Type: Improvement
>          Components: JDBC
>    Affects Versions: 0.10.0
>            Reporter: Lukas Eder
>         Attachments: HIVE-4499.patch
>
>
> The Hive JDBC ResultSet cannot convert from Double to BigDecimal, as can be seen in this
code extract here:
> {code}
>  public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
>     Object obj = getObject(columnIndex);
>     if (obj == null) {
>       return null;
>     }
>     if (obj instanceof BigDecimal) {
>       return ((BigDecimal) obj);
>     }
>     if (obj instanceof HiveDecimal) {
>       return ((HiveDecimal) obj).bigDecimalValue();
>     }
>     throw new SQLException("Cannot convert column " + columnIndex
>                            + " to BigDecimal. Found data of type: "
>                            + obj.getClass()+", value: " + obj.toString());
> }
> {code}
> Taken from:
> https://github.com/apache/hive/blob/trunk/jdbc/src/java/org/apache/hadoop/hive/jdbc/HiveBaseResultSet.java#L107
> This results in interoperability problems with other APIs, such as jOOQ, as can be seen
in this issue here:
> https://github.com/jOOQ/jOOQ/issues/2442
> It would be nice if Hive could implement more versatile data type conversions in its
ResultSet (not just for Double/BigDecimal). Some inspiration could be taken from
> - Derby (http://db.apache.org/derby)
> - H2 (http://www.h2database.com)
> - HSQLDB (http://hsqldb.org)
> - jOOQ (http://www.jooq.org)
> All of the above implement ResultSets with lots of data type conversion capabilities.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message