[
https://issues.apache.org/jira/browse/CALCITE-1050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15973672#comment-15973672
]
Josh Elser commented on CALCITE-1050:
-------------------------------------
I've been poking at {{ArrayIT}} in Phoenix and it seems like Phoenix was making
some assumptions that it would get a {{PhoenixArray}} as the bound parameter
value whereas, with these changes, it's actually get an Java array (e.g.
{{Object[]}}). This is a result of {{PhoenixCalciteConnection}} calling
{{toJdbc(..)}} on {{TypedValue}}. Per the Javadoc (that predates me), the JDBC
form of an ARRAY would be an {{Object[]}}. Thus, the {{RuntimeContextImpl}}
generates {{Object[]}}'s for the {{Array}}'s, and Phoenix later tries to cast
the {{Object[]}} to an {{Array}} (granted, a {{PhoenixArray}} which wouldn't
work at all -- but an {{Array}} would also fail). So, I'm not sure there's much
more we can glean from Phoenix to assert correctness here (requires more work
in Phoenix).
But, before I push this in, I am left wondering: [~julianhyde], is the JDBC
form of an {{Array}} an {{Object[]}} correct? (for context:
https://github.com/joshelser/calcite-avatica/blob/1050-arrays/core/src/main/java/org/apache/calcite/avatica/remote/TypedValue.java#L112-L113).
The method signature of {{PreparedStatement.setArray(int, Array)}} as opposed
to {{PreparedStatement.setArray(int, Object)}} (or some form of a Java array,
Object or primitive).
> Avatica can't serialize java.sql.Array
> --------------------------------------
>
> Key: CALCITE-1050
> URL: https://issues.apache.org/jira/browse/CALCITE-1050
> Project: Calcite
> Issue Type: Improvement
> Components: avatica
> Affects Versions: 1.5.0
> Reporter: Lukas Lalinsky
> Assignee: Josh Elser
> Fix For: avatica-1.10.0
>
>
> As far as I can see, there is no way to serialize arrays in the Avatica RPC.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)