calcite-avatica icon indicating copy to clipboard operation
calcite-avatica copied to clipboard

CALCITE-3533 - Map non-jdbc data types to ANY in JdbcSchema

Open jeremyosterhoudt opened this issue 5 months ago • 3 comments

This PR allows non-standards JDBC/SQL types to be processed as ANY. Databases such as Oracle and SQLServer (among others) often support SQL types that are not defined as part of the standard Java JDBC type mapping.

Currently Avatica (and by proxy Calcite) throw an exception when these types are encountered. However, for many non-standard types this prevents the query from executing successfully even though the results are retrieved and displayed correctly when ANY is used for these scenarios (SQLSever's DataTimeOffset for example).

While this is not a fix per se I do believe this is an improvement over the current behavior. Types could be added directly, however, some types like Oracle's DateTime With Offset require the Oracle JDBC driver to convert. This would mean including the JDBC driver in Avatica with is likely undesirable. Ideally I think a nice enhancement would be to allow developers/users to specify a non-standard type conversion class/factory that could be called when these types are encountered while embedding any needed libraries (I'm hoping to have a conversation around this and partake in the implementation).

jeremyosterhoudt avatar Jul 23 '25 22:07 jeremyosterhoudt