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

Simplifying CAST(characterLiteral as TIMESTAMP) should round the sub-second fraction

    Details

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

      Description

      Timestamps are losing sub-second parts after Calcite literal constant reduction.

      select cast("1970-12-31 15:59:58.174" as TIMESTAMP) from src limit 1;
      

      yields 1970-12-31 15:59:58 if CBO is enabled in Hive. ZonelessTimestamp.toString() contains a truncation 0-19 (ie. removes sub-second part from string representation).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                julianhyde Julian Hyde
                Reporter:
                rusanu Remus Rusanu
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: