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

Istvan Toth commented on PHOENIX-6606:
--------------------------------------

This is possibly two different issues.

1. seems to be an Avatica issue, and I ask you to re-test with PQS HEAD.

2. seems to be coming from Phoenix itself.
Does "upsert into s1.datatype(t_uuid, t_float) values(?, ARRAY[1.0f, 2.0f])" 
work ?

> Cannot use float array data type with PQS client
> ------------------------------------------------
>
>                 Key: PHOENIX-6606
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6606
>             Project: Phoenix
>          Issue Type: Bug
>          Components: queryserver
>            Reporter: Cong Luo
>            Priority: Minor
>
> IDE use the PQS client with the 6.0.0, then write and read the float data 
> array got :
> case 1 (cannot be written) :
> {code:java}
> Array t_float = conn.createArrayOf("FLOAT", new Float[] { Float.MIN_VALUE, 
> Float.MAX_VALUE });
> pstmt = conn.prepareStatement("upsert into s1.datatype(t_uuid, t_float) 
> values(?, ?)");
> pstmt.setArray(2, t_float);{code}
> {code:java}
> Exception in thread "main" java.sql.SQLException: java.lang.Float cannot be 
> cast to java.lang.Double
>     at org.apache.calcite.avatica.Helper.createException(Helper.java:56)
>     at org.apache.calcite.avatica.Helper.createException(Helper.java:41)
>     at 
> org.apache.calcite.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:557)
>     at 
> org.apache.calcite.avatica.AvaticaPreparedStatement.executeLargeUpdate(AvaticaPreparedStatement.java:152)
>     at 
> org.apache.calcite.avatica.AvaticaPreparedStatement.executeUpdate(AvaticaPreparedStatement.java:147)
>  {code}
>  
> case 2 (can be written and cannot be read) :
> {code:java}
> pstmt = conn.prepareStatement("upsert into s1.datatype(t_uuid, t_float) 
> values(?, ARRAY[1.0, 2.0])");{code}
> {code:java}
> Exception in thread "main" org.apache.calcite.avatica.AvaticaSqlException: 
> Error -1 (00000) : Remote driver error: ClassCastException: (null exception 
> message)     at 
> org.apache.calcite.avatica.Helper.createException(Helper.java:54)     at 
> org.apache.calcite.avatica.Helper.createException(Helper.java:41)     at 
> org.apache.calcite.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:557)
>      at 
> org.apache.calcite.avatica.AvaticaPreparedStatement.executeQuery(AvaticaPreparedStatement.java:137)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to