Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-21617 FLIP-162: Consistent Flink SQL time function behavior
  3. FLINK-21714

Use TIMESTAMP_LTZ as return type for function PROCTIME()

    XMLWordPrintableJSON

    Details

    • Release Note:
      Hide
      Before Flink 1.13, the function return type of `PROCTIME()` is `TIMESTAMP`, and the return value is the `TIMESTAMP` in UTC time zone,
      e.g. the wall-clock shows `2021-03-01 12:00:00` at Shanghai, however the `PROCTIME()` displays `2021-03-01 04:00:00` which is wrong.
      Flink 1.13 fixes this issue and uses `TIMESTAMP_LTZ` type as return type of `PROCTIME()`, users don't need to deal time zone problems anymore.
      Show
      Before Flink 1.13, the function return type of `PROCTIME()` is `TIMESTAMP`, and the return value is the `TIMESTAMP` in UTC time zone, e.g. the wall-clock shows `2021-03-01 12:00:00` at Shanghai, however the `PROCTIME()` displays `2021-03-01 04:00:00` which is wrong. Flink 1.13 fixes this issue and uses `TIMESTAMP_LTZ` type as return type of `PROCTIME()`, users don't need to deal time zone problems anymore.

      Description

      When users use a PROCTIME() in SQL, the return value of PROCTIME() has a timezone offset with the wall-clock time in users' local time zone, users need to add their local time zone offset manually to get expected local timestamp(e.g: Users in Germany need to +1h to get expected local timestamp). 

      This issue to correct PROCTIME()  function

      function existed problem current behavior proposed changes
      PROCTIME() returns UTC timestamp, but user expects current timestamp in session time zone return type: TIMESTAMP  PROCTIME
      #session timezone: UTC
      2020-12-28 23:52:52
      #session timezone: UTC+8
      2020-12-28 23:52:52
      return current timestamp in session time zone for PROCTIME(), the return type should be TIMESTAMP  WITH LOCAL TIME ZONE *PROCTIME*
      #session timezone: UTC
      2020-12-28 23:52:52
      #session timezone: UTC+8
      2020-12-29 07:52:52

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Leonard Xu Leonard Xu
                Reporter:
                Leonard Xu Leonard Xu
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: