Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-5180 Implement BigQuery functions for DATE, TIME, TIMESTAMP, DATETIME
  3. CALCITE-5436

Implement DATE_SUB, TIME_SUB, TIMESTAMP_SUB (compatible w/ BigQuery)

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.33.0
    • None

    Description

      Implement BigQuery's TIME_SUB, TIMESTAMP_SUB, and DATE_SUB functions. Each of these functions follows similar behavior, the primary difference being whether the specified interval is being subtracted from a TIME, TIMESTAMP, or DATE expression. Examples for each are provided below:

      TIME_SUB: TIME_SUB(TIME '15:30:00', INTERVAL 10 MINUTE) would output '15:20:00'.

      TIMESTAMP_SUB: TIMESTAMP_SUB(TIMESTAMP '2008-12-25 15:30:00, INTERVAL 1 HOUR) would output '2008-12-25 14:30:00'.

      DATE_SUB: DATE_SUB(DATE '2008-12-25', INTERVAL 2 DAY) would output '2008-12-27'.

      Attachments

        Issue Links

          Activity

            People

              tanclary Tanner Clary
              tanclary Tanner Clary
              Votes:
              0 Vote for this issue
              Watchers:
              3 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 - 50m
                  50m