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

Add timezone support for FORMAT clause in CAST (enabled in BigQuery)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      This issue is a followup on CALCITE-6269 that fixes some of Calcite's existing format elements implementation to be aligned to BQ functionality. Two major formats that might require a bit more rework is adding support for the TZH/TZM elements along with time zone areas as described below:

      • Parsing timestamp literals with timezones as used by BQ does not seem to be supported yet (format element TZR is unimplemented, BQ has TZH, TZM for hour and minute offsets)
        (eg: cast('2020.06.03 00:00:53+00' as timestamp format 'YYYY.MM.DD HH:MI:SSTZH')
      • BQ format timezone as string can take an additional argument AT TIME ZONE 'Asia/Kolkata', which would require additional parser changes and time zone parameter to be plumbed in to the cast operator call.

      One important thing to consider, is that the SimpleDateFormat class which currently stores the datetime object in CAST, may not fully support timezone features as described and might warrant a broader refactoring of this code to use timezone compatible data types.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jerin_john Jerin John
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: