[
https://issues.apache.org/jira/browse/CALCITE-6637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17891587#comment-17891587
]
Caican Cai commented on CALCITE-6637:
-------------------------------------
[~mbudiu] Sorry, it seems that there is something wrong with my expression,
which caused misunderstanding.
Currently, Calcite returns the timestamp type for the arrow date type, which is
wrong. It should return the date type. This is a bug.
My PR fixes this bug
> The result of date type will be automatically converted to timestamp type in
> the Arrow adapter
> ----------------------------------------------------------------------------------------------
>
> Key: CALCITE-6637
> URL: https://issues.apache.org/jira/browse/CALCITE-6637
> Project: Calcite
> Issue Type: Bug
> Components: arrow-adapter
> Affects Versions: 1.38.0
> Reporter: Caican Cai
> Priority: Critical
> Labels: pull-request-available
> Fix For: 1.39.0
>
>
> When returning the result, the date type in arrow will be converted to
> timestamp type.
> {code:java}
> @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);
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)