Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.21.0
Description
A similar test like ReflectiveSchemaTest#testDateCanCompare
@Test public void testDateCanCompare2() { final String sql = "select a.v1, a.v2\n" + "from (select \"sqlTime\" v1, \"sqlTimestamp\" v2\n" + " from \"s\".\"everyTypes\" " + " group by \"sqlTime\", \"sqlTimestamp\") a," + " (select \"sqlTime\" v1, \"sqlTimestamp\" v2\n" + " from \"s\".\"everyTypes\"\n" + " group by \"sqlTime\", \"sqlTimestamp\") b\n" + "where a.v1 >= b.v1 and a.v2 >= b.v2\n" + "group by a.v1, a.v2"; CalciteAssert.that() .withSchema("s", CATCHALL) .query(sql) .returnsUnordered("V1=00:00:00; V2=1970-01-01 00:00:00"); }
The query fails with exception:
Caused by: java.lang.ClassCastException: java.sql.Time cannot be cast to java.lang.Integer at Baz$10$1.moveNext(Unknown Source) at org.apache.calcite.linq4j.EnumerableDefaults.groupBy_(EnumerableDefaults.java:825) at org.apache.calcite.linq4j.EnumerableDefaults.groupBy(EnumerableDefaults.java:764) at org.apache.calcite.linq4j.DefaultEnumerable.groupBy(DefaultEnumerable.java:308) at Baz.bind(Unknown Source)
We also need to support type cast from Time/TimeStamp to Integer/Long
Attachments
Issue Links
- blocks
-
CALCITE-3520 Type cast from primitive to box is not correct
- Closed
- links to