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

ClassCastException retrieving from ARRAY that has mixed INTEGER and DECIMAL elements

    XMLWordPrintableJSON

Details

    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

        Issue Links

          Activity

            People

              Sergey Nuyanzin Sergey Nuyanzin
              Sergey Nuyanzin Sergey Nuyanzin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m