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

Support implicit cast conversion between timestamp and timestamp_ltz

    XMLWordPrintableJSON

Details

    Description

      The existed UDFs using `LocalDateTime` or `java.sql.Timestamp` as parameters type, if the data type of parameter column in SQL changed from TIMESTAMP to TIMESTAMP_LTZ, these UDFs must be rewritten, because TIMESTAMP_LTZ data type does not support `LocalDateTime` or `java.sql.Timestamp` as conversion class.

       

      The first approach is to support the two conversion classes  for TIMESTAMP_LTZ  data type, to obtain the correct result, the local time zone information is necessary when conversion happens between  SQL internal data structure `TimestampData` and external conversion class `LocalDateTime` or `java.sql.Timestamp`.

      In this approach, after a e2e POC, we found that there are more changes than we thought before. It is difficult to cover with tests and it is easy to introduce bugs.

       

      Thus, to resolve the UDF compatibility issue, we consider support the implicit cast conversion between timestamp and timestamp_ltz after some offline discuss with jark and ykt836,

      This way is clean and lightweight way to resolve the UDF compatibility issue and doesn't change any public interface as well.  BTW the  implicit cast conversion is supported in Oracle[1] 

       

      [1]https://docs.oracle.com/cd/B19306_01/server.102/b14225/ch4datetime.htm

       

      Attachments

        Issue Links

          Activity

            People

              leonard Leonard Xu
              leonard Leonard Xu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: