Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
avatica-1.17.0
Description
cases to reproduce
select array[current_date]; select array[cast('1900-1-1' as date)]; select array[current_timestamp]; select array[current_time];
each query fails with ClassCastException mentioned below.
It seems the reason is that date/time/timestamp could be both int/long and java_sql_*.
class java.sql.Date cannot be cast to class java.lang.Number (java.sql.Date is in module java.sql of loader 'platform'; java.lang.Number is in module java.base of loader 'bootstrap') java.lang.ClassCastException: class java.sql.Date cannot be cast to class java.lang.Number (java.sql.Date is in module java.sql of loader 'platform'; java.lang.Number is in module java.base of loader 'bootstrap') at org.apache.calcite.avatica.util.AbstractCursor$NumberAccessor.getNumber(AbstractCursor.java:722) at org.apache.calcite.avatica.util.AbstractCursor$DateFromNumberAccessor.getString(AbstractCursor.java:928) at org.apache.calcite.avatica.util.ArrayImpl.toString(ArrayImpl.java:62) at org.apache.calcite.avatica.util.AbstractCursor$ArrayAccessor.getString(AbstractCursor.java:1365) at org.apache.calcite.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:239)
Attachments
Issue Links
- is related to
-
CALCITE-4602 ClassCastException retrieving from ARRAY that has mixed INTEGER and DECIMAL elements
- Closed
- relates to
-
CALCITE-4762 Upgrade Calcite to Avatica 1.19
- Closed
- links to