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

Aman Poonia commented on PHOENIX-6630:
--------------------------------------

I tried the same in Array1IT in testScanWithNonFixedWidthArrayInWhereClause and 
somehow my tests are passing after changing from setArrray to setObject.

> 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)

Reply via email to