[ https://issues.apache.org/jira/browse/CALCITE-3894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17079010#comment-17079010 ]
Danny Chen edited comment on CALCITE-3894 at 4/9/20, 7:28 AM: -------------------------------------------------------------- Yes, the IN, CASE, and UNION all have such behaviors, this is always the behavior of Caicite with the logic defined in RelDataTypeFactory#leastRestrictive, we should force an implicit type coercion here instead as a validation fallback. was (Author: danny0405): Yes, the IN, CASE, and UNION all has such behaviors, this is always the behavior of Caicite with the logic defined in RelDataTypeFactory#leastRestrictive, we should force a implicit type coercion here instead as a validation fallback. > The Union operation between DATE with TIMESTAMP returns a wrong result > ---------------------------------------------------------------------- > > Key: CALCITE-3894 > URL: https://issues.apache.org/jira/browse/CALCITE-3894 > Project: Calcite > Issue Type: Bug > Reporter: TANG Wen-hui > Assignee: TANG Wen-hui > Priority: Major > > {code:java} > @Test public void testUnionTime() { > CalciteAssert.AssertThat assertThat = CalciteAssert.that(); > String query = "select * from (\n" > + "select \"id\" from (VALUES(DATE '2018-02-03')) \"foo\"(\"id\")\n" > + "union\n" > + "select \"id\" from (VALUES(TIMESTAMP '2008-03-31 12:23:34')) > \"foo\"(\"id\"))"; > assertThat.query(query).returns("id=2108-03-12\nid=2018-02-03\n"); > }{code} > The test with wrong result passed. > -- This message was sent by Atlassian Jira (v8.3.4#803005)