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

Zhengqiang Duan commented on CALCITE-1466:
------------------------------------------

I did some investigation on Calcite's support for UNSIGNED types. In general, 
we can handle them by mapping a wider range of Java types. For example, the 
`BIGINT` type is usually mapped to `java.lang.Long` for processing, while 
`BIGINT UNSIGNED` needs to be mapped to `java.math.BigInteger` for processing. 
For more type mappings, please refer to the document: 
[https://dev.mysql.com/doc/connector-j/en/connector-j-reference-type-conversions.html]

To implement Calcite UNSIGNED type support, we need to do it in 2 steps:
 # Support unsigned type in calcite-avatica. Currently, the signed attribute is 
provided in ColumnMetaData. We can refer to signed to handle unsigned type 
values——already implemented, refer to PR-275: 
https://github.com/apache/calcite-avatica/pull/275/files;
 # Add more SqlTypeName in calcite to handle unsigned type, then pass the 
correct signed type in the calcite jdbc implementation and support unsigned 
type execution.

> Support for UNSIGNED types of TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT in 
> type system
> --------------------------------------------------------------------------------------
>
>                 Key: CALCITE-1466
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1466
>             Project: Calcite
>          Issue Type: Bug
>          Components: avatica
>            Reporter: Rajeshbabu Chintaguntla
>            Assignee: Zhengqiang Duan
>            Priority: Major
>              Labels: pull-request-available
>
> There are some data bases like MySQL supporting unsigned data types.  Apache 
> Phoenix also supports them. Would be great to add them to calcite as well.
> http://dev.mysql.com/doc/refman/5.7/en/integer-types.html



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to