You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Knut Forkalsrud (Jira)" <ji...@apache.org> on 2021/12/30 23:37:00 UTC

[jira] [Created] (CALCITE-4970) Avatica ResultSet getObject with class argument fails unnecessarily

Knut Forkalsrud created CALCITE-4970:
----------------------------------------

             Summary: Avatica ResultSet getObject with class argument fails unnecessarily
                 Key: CALCITE-4970
                 URL: https://issues.apache.org/jira/browse/CALCITE-4970
             Project: Calcite
          Issue Type: Improvement
          Components: avatica
    Affects Versions: avatica-1.20.0
            Reporter: Knut Forkalsrud


The default implementation of Avatica's Cursor method

{{public <T> T getObject(Class<T> type) throws SQLException}}

thrown an exception about not being able to convert. However, there is the trivial case when no conversion is necessary. I propose returning the same value as {{getObject()}} does, when that's an acceptable type.

 

The background for this is our experience with different JDBC drivers. Our in-house "query master" tries to visualize result sets. We use {{ResultSetMetaData.getColumnTypeName}} to figure out which type to expect. Some drivers don't necessarily produce objects of the same type when we call {{{}getObject{}}}, but they do convert to the right type when we call the method with the class as an argument.

 

Pull request forthcoming.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)