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

[jira] [Commented] (CALCITE-2933) In Druid adapter, expression like "cast(cast(\"timestamp\" as timestamp) as varchar)" returns as epoch millisecond

    [ https://issues.apache.org/jira/browse/CALCITE-2933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16841122#comment-16841122 ] 

Danny Chan commented on CALCITE-2933:
-------------------------------------

Fixed in [https://github.com/apache/calcite/commit/7df06784a725bd9bde421b5d86ac69a3e30d66b4] !

> In Druid adapter, expression like "cast(cast(\"timestamp\" as timestamp) as varchar)" returns as epoch millisecond
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-2933
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2933
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.18.0
>            Reporter: Hongze Zhang
>            Assignee: Danny Chan
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> SQL 1:
> {code}
> select cast("timestamp" as timestamp) as t from "foodmart" order by t limit 1
> {code}
> Result:
> {code}
> T=1997-01-01 00:00:00
> {code}
> SQL 2:
> {code}
> select cast(cast("timestamp" as timestamp) as varchar) as t from "foodmart" order by t limit 1
> {code}
> Result:
> {code}
> T=852076800000
> {code}
> The second query should returns with the same format as the first one.
> See test case:
> https://github.com/apache/calcite/blob/1229ef27094ea73ad9c7a397f442285c7e1df9b0/druid/src/test/java/org/apache/calcite/test/DruidAdapterIT2.java#L3930



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