[
https://issues.apache.org/jira/browse/PHOENIX-843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13933528#comment-13933528
]
James Taylor commented on PHOENIX-843:
--------------------------------------
One more consideration is our "UNSIGNED" types. JDBC doesn't seem to have
java.sql.Types for those. I know that other database support this notion,
though, so I'm wondering how this should be surfaced. We currently just return
our internal typeId for these in DatabaseMetaData#getColumn, but we return the
regular, standard signed type in ResultSetMetaData#getColumnType.
Some background on these types: they exist solely as a bridge between Phoenix
(given its requirement that the bytes comparison match the natural sort order
of a value) and the default serialization done by the HBase utility methods in
org.apache.hadoop.hbase.util.Bytes. So if a user has existing HBase data and
they'd like to map a Phoenix table to this data, they are able to with the
caveat that they're only using non negative numbers. Getting into too much
detail here, but the reason is that these utility methods don't flip the sign
bit of long, int, etc, so with the byte[] representation, negative numbers sort
as higher than positive numbers.
> Incorrect java.sql.Types value returned for array types in result set
> ---------------------------------------------------------------------
>
> Key: PHOENIX-843
> URL: https://issues.apache.org/jira/browse/PHOENIX-843
> Project: Phoenix
> Issue Type: Bug
> Reporter: Gabriel Reid
> Attachments: PHOENIX-843.patch
>
>
> All array PDataTypes currently return their Phoenix-specific type constant in
> PDataType#getResultSetSqlType. This causes issues with external tools which
> aren't familiar with the Phoenix array types, so java.sql.Types.ARRAY should
> be returned for array types instead.
--
This message was sent by Atlassian JIRA
(v6.2#6252)