You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Jon Pither <jo...@gmail.com> on 2020/06/03 17:46:48 UTC

Avatica results mapping

Hi,

I have a data-type I'm mapping as SqlTypeName/OTHER - in this case
java.util.UUID. When I return this field from an enumerator via an adapter
it works OK - the UUID is passed through into the JDBC result set.

Over the wire though, Avatica throws an error " Remote driver error:
RuntimeException: Unhandled type in Frame: class java.util.UUID".

I'm contemplating what to do here - is it possible to convert the UUID to a
string in the case of 'on the wire' for avatica only? But then pass through
the UUID for straight through Calcite?

Regards,

Jon.

Re: Avatica results mapping

Posted by Julian Hyde <jh...@apache.org>.
This problem keeps on coming up. Avatica doesn't handle extended data
types very well. I think we hard-code support for everything in
java.sql.Types but then we hit the wall when things are "OTHER".

There are also types that are widely used that are not in
java.sql.Types - e.g. GEOMETRY. They may or may not have an accepted
integer type id.

I would love to find a robust solution. Especially to be able to add a
new type on the server without modifying the wire protocol or the
Avatica client.

We should make more use of JDBC type maps, e.g.
"ResultSet.getObject(int, Map<String, Class>)" [1]

Julian

[1] https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.html#getObject-int-java.util.Map-

On Wed, Jun 3, 2020 at 10:44 AM Jon Pither <jo...@gmail.com> wrote:
>
> Hi,
>
> I have a data-type I'm mapping as SqlTypeName/OTHER - in this case
> java.util.UUID. When I return this field from an enumerator via an adapter
> it works OK - the UUID is passed through into the JDBC result set.
>
> Over the wire though, Avatica throws an error " Remote driver error:
> RuntimeException: Unhandled type in Frame: class java.util.UUID".
>
> I'm contemplating what to do here - is it possible to convert the UUID to a
> string in the case of 'on the wire' for avatica only? But then pass through
> the UUID for straight through Calcite?
>
> Regards,
>
> Jon.