[
https://issues.apache.org/jira/browse/PHOENIX-6630?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17638608#comment-17638608
]
Aman Poonia commented on PHOENIX-6630:
--------------------------------------
Example test
[https://github.com/apache/phoenix/blob/master/phoenix-core/src/test/java/org/apache/phoenix/util/AbstractUpsertExecutorTest.java#L154]
> PreparedStatement setObject should call setArray for PhoenixArrays
> ------------------------------------------------------------------
>
> Key: PHOENIX-6630
> URL: https://issues.apache.org/jira/browse/PHOENIX-6630
> Project: Phoenix
> Issue Type: Improvement
> Reporter: Geoffrey Jacoby
> Assignee: Geoffrey Jacoby
> Priority: Minor
>
> Phoenix supports JDBC array types in SQL via the PreparedStatement setArray
> method. Passing a PhoenixArray to setObject results in an exception as it
> goes down a code path assuming it's a literal.
> Other JDBC-based drivers such as Oracle allow setObject to be used for arrays
> as well as scalars. The fix looks to be pretty simple -- just check in
> setObject if the parameter type is an instanceof PhoenixArray (or maybe
> java.sql.Array) and just pass on to setArray internally.
> This makes type-agnostic Statement building easier (for example in
> PhoenixTestBuilder)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)