Hi all,
In flink-table-common in DateTimeUtils class there are several dateFormat
methods.
Based on documentation [1] DATE_FORMAT Built-in function it should be
compatible with SimpleDateFormat.
However in fact it is compatible only for timestamps with non local
timezones while for timestamps with local timezones it uses
DateTimeFormatter.
It means that for some cases output could depend on if timestamp with local
timezone or not, e.g.
`u` for SimpleDateFormat means day number of week,
    while for DateTimeFormatter it means year.
+ as a result for timestamps with local timezone it is possible to use some
extra patterns like `q`, `Q`, `e`, `c`,
while DATE_FORMAT for timestamps with non-local timezones with the same
patterns fails.

Do you have any opinions about moving forward only with DateTimeFormatter
here inside DateTimeUtils?
Or is there a case when DateTimeFormatter is not suitable and
SimpleDateFormat for DATE_FORMAT is required?
If yes, could you please describe your use case?

[1]
https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/functions/systemfunctions/#temporal-functions

-- 
Best regards,
Sergey

Reply via email to