Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2933

In Druid adapter, expression like "cast(cast(\"timestamp\" as timestamp) as varchar)" returns as epoch millisecond

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.18.0
    • Fix Version/s: 1.20.0
    • Component/s: None

      Description

      SQL 1:

      select cast("timestamp" as timestamp) as t from "foodmart" order by t limit 1
      

      Result:

      T=1997-01-01 00:00:00
      

      SQL 2:

      select cast(cast("timestamp" as timestamp) as varchar) as t from "foodmart" order by t limit 1
      

      Result:

      T=852076800000
      

      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

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              danny0405 Danny Chen
              Reporter:
              zhztheplayer Hongze Zhang

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 10m
                1h 10m

                  Issue deployment