Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
1.38.0
Description
Currently, Calcite returns the timestamp type for the arrow date type, which is wrong. It should return the date type.
Currently
@Test void testDateProject() { String sql = "select HIREDATE from EMP"; String plan = "PLAN=ArrowToEnumerableConverter\n" + " ArrowProject(HIREDATE=[$4])\n" + " ArrowTableScan(table=[[ARROW, EMP]], fields=[[0, 1, 2, 3, 4, 5, 6, 7]])\n\n"; String result = "HIREDATE=1970-01-01 00:00:04\n" + "HIREDATE=1970-01-01 00:00:04\n" + "HIREDATE=1970-01-01 00:00:04\n"; CalciteAssert.that() .with(arrow) .query(sql) .limit(3) .returns(result) .explainContains(plan);
The correct one is
@Test void testDateProject() { String sql = "select HIREDATE from EMP"; String plan = "PLAN=ArrowToEnumerableConverter\n" + " ArrowProject(HIREDATE=[$4])\n" + " ArrowTableScan(table=[[ARROW, EMP]], fields=[[0, 1, 2, 3, 4, 5, 6, 7]])\n\n"; String result = "HIREDATE=1980-12-17\nHIREDATE=1981-02-20\nHIREDATE=1981-02-22\n"; CalciteAssert.that() .with(arrow) .query(sql) .limit(3) .returns(result) .explainContains(plan); }
Attachments
Issue Links
- links to