[
https://issues.apache.org/jira/browse/PHOENIX-843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13932955#comment-13932955
]
Gabriel Reid commented on PHOENIX-843:
--------------------------------------
{quote}How do the external tools know the element type?{quote}
I think that the best (maybe only) way for an external tool to figure out the
element type is by looking at the type name. That's a pretty lame (and
db-specific) way of having to figure out the element type, but I think that's
just how things go when dealing with arrays via JDBC. Based on my read of the
[javadocs for
Array|http://docs.oracle.com/javase/6/docs/api/java/sql/Array.html], arrays in
JDBC are pretty much like Blobs, in that they're a reference pointer containing
"something", and that something isn't necessarily that well defined, making it
incredibly difficult to determine what the element type is.
That being said, the javadocs for both
[ResultSetMetaData#getColumnType|http://docs.oracle.com/javase/6/docs/api/java/sql/ResultSetMetaData.html#getColumnType(int)]
and
[DatabaseMetaData#getColumns|http://docs.oracle.com/javase/6/docs/api/java/sql/DatabaseMetaData.html#getColumns(java.lang.String,
java.lang.String, java.lang.String, java.lang.String)] make it pretty clear
that the type returned should be one of the constants defined in java.sql.Types.
> 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)