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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.18.0
    • 1.20.0
    • 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

              danny0405 Danny Chen
              zhztheplayer Hongze Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              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