You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Danny Chan (JIRA)" <ji...@apache.org> on 2019/03/20 12:55:00 UTC

[jira] [Created] (CALCITE-2938) Druid adapter do wrong behavior for casts from timestamp type to date type

Danny Chan created CALCITE-2938:
-----------------------------------

             Summary: Druid adapter do wrong behavior for casts from timestamp type to date type
                 Key: CALCITE-2938
                 URL: https://issues.apache.org/jira/browse/CALCITE-2938
             Project: Calcite
          Issue Type: Improvement
          Components: druid
    Affects Versions: 1.19.0
            Reporter: Danny Chan
            Assignee: Danny Chan
             Fix For: 1.20.0


For sql like 

{code:java}
Select cast("timestamp" as date) as t from "foodmart" order by t limit 1
{code}
It produces results:
3242-06-03
while it expects to be:
1997-01-01

You can past the code
{code:java}
@Test
  public void testCastTimestamp() {
    final String sql = "Select cast(\"timestamp\" as date) as t"
        + " from \"foodmart\" order by t limit 1";

    sql(sql, FOODMART)
        .returnsOrdered("T=1997-01-01 00:00:00")
        .queryContains(
            druidChecker("UTC"));
  }
{code}
in DruidAdapterIT2 and reproduce it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)