Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4602

ClassCastException for arrays with int and decimal elements within one array

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: avatica-1.17.0
    • Fix Version/s: None
    • Component/s: avatica
    • Labels:
      None

      Description

      Cases to reproduce: any query with array containing both int and bigdecimal elements for instance

      select array[1, 1.1];
      select array[1.1, 1];
      

      which leads to ClassCastException

      class java.lang.Integer cannot be cast to class java.math.BigDecimal (java.lang.Integer and java.math.BigDecimal are in module java.base of loader 'bootstrap')
      java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.math.BigDecimal (java.lang.Integer and java.math.BigDecimal are in module java.base of loader 'bootstrap')
      	at org.apache.calcite.avatica.util.AbstractCursor$BigDecimalAccessor.getBigDecimal(AbstractCursor.java:701)
      	at org.apache.calcite.avatica.util.AbstractCursor$ArrayAccessor.convertValue(AbstractCursor.java:1338)
      	at org.apache.calcite.avatica.util.AbstractCursor$ArrayAccessor.getObject(AbstractCursor.java:1299)
      	at org.apache.calcite.avatica.util.AbstractCursor$ArrayAccessor.getArray(AbstractCursor.java:1352)
      	at org.apache.calcite.avatica.util.AbstractCursor$ArrayAccessor.getString(AbstractCursor.java:1364)
      	at org.apache.calcite.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:239)
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Sergey Nuyanzin Sergey Nuyanzin
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: