Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-6606

Cannot use float array data type with PQS client

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • queryserver
    • None

    Description

      IDE use the PQS client with the 6.0.0, then write and read the float data array got :

      case 1 (cannot be written) :

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

       

      case 2 (can be written and cannot be read) :

      pstmt = conn.prepareStatement("upsert into s1.datatype(t_uuid, t_float) values(?, ARRAY[1.0, 2.0])");
      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)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            luoc Cong Luo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: