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

Julian Hyde commented on CALCITE-1927:
--------------------------------------

To keep this simple, remember we're just considering the driver, not the 
database. The database prepares the query and knows that it has a column whose 
type is say, BIT(21), and tells that to Avatica.

> Mapping for Types.BIT: boolean or BitSet?
> -----------------------------------------
>
>                 Key: CALCITE-1927
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1927
>             Project: Calcite
>          Issue Type: Bug
>          Components: avatica
>    Affects Versions: 1.13.0
>            Reporter: Vladimir Sitnikov
>              Labels: pgjdbc, postgresql
>
> Currently Avatica implements `Types.BIT` as `Boolean` (see 
> https://github.com/apache/calcite-avatica/blob/4db1fb9c66db8ccebc9e96ce678154ec69c557f0/core/src/main/java/org/apache/calcite/avatica/AvaticaSite.java#L227-L230
>  )
> Certain databases (e.g. PostgreSQL) have {{bit\(n)}} and {{varbit\(n)}} data 
> types that are "bit strings" (see 
> https://www.postgresql.org/docs/9.6/static/datatype-bit.html )
> If both used together, {{getObject}} just blows when trying to convert thing 
> like {{'01101'}} to a boolean.
> I wonder what should be the behavior for {{Types.BIT}}.
> The original discussion is here: https://github.com/pgjdbc/pgjdbc/issues/908
> PS. I'm not using Avatica + PostgreSQL + varbit combo yet, however I just 
> want to weight different implementation options, and make it simpler for 
> different JDBC implementations to talk to each other.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to