Geoffrey Jacoby created PHOENIX-6630:
----------------------------------------

             Summary: 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


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.1#820001)

Reply via email to