Jacky Lau created FLINK-37854:
---------------------------------
Summary: UnsupportedTemporalTypeException: Unsupported field:
OffsetSeconds
Key: FLINK-37854
URL: https://issues.apache.org/jira/browse/FLINK-37854
Project: Flink
Issue Type: Bug
Components: Table SQL / Planner
Affects Versions: 2.1.0
Reporter: Jacky Lau
Fix For: 2.1.0
spark supports, while flink doesn't
{code:java}
spark-sql (default)> SELECT DATE_FORMAT(CURRENT_TIMESTAMP, 'yyyy-MM-dd
HH:mm:ssXXX');
2025-05-27 10:23:50+08:00
Time taken: 4.358 seconds, Fetched 1 row(s)
spark-sql (default)> SELECT DATE_FORMAT(CURRENT_TIMESTAMP, 'yyyy-MM-dd
HH:mm:ssX');
2025-05-27 10:23:57+08
Time taken: 0.062 seconds, Fetched 1 row(s)
spark-sql (default)> SELECT DATE_FORMAT(CURRENT_TIMESTAMP, 'yyyy-MM-dd
HH:mm:ssXX');
2025-05-27 10:24:17+0800 {code}
{code:java}
Caused by: java.time.temporal.UnsupportedTemporalTypeException: Unsupported
field: OffsetSeconds
at java.base/java.time.LocalDate.get0(LocalDate.java:709)
at java.base/java.time.LocalDate.getLong(LocalDate.java:688)
at java.base/java.time.LocalDateTime.getLong(LocalDateTime.java:718)
at
java.base/java.time.format.DateTimePrintContext.getValue(DateTimePrintContext.java:308)
at
java.base/java.time.format.DateTimeFormatterBuilder$OffsetIdPrinterParser.format(DateTimeFormatterBuilder.java:3628)
at
java.base/java.time.format.DateTimeFormatterBuilder$CompositePrinterParser.format(DateTimeFormatterBuilder.java:2402)
at
java.base/java.time.format.DateTimeFormatter.formatTo(DateTimeFormatter.java:1849)
at
java.base/java.time.format.DateTimeFormatter.format(DateTimeFormatter.java:1823)
at java.base/java.time.LocalDateTime.format(LocalDateTime.java:1746)
at
org.apache.flink.table.utils.DateTimeUtils.formatTimestamp(DateTimeUtils.java:799)
at
org.apache.flink.table.utils.DateTimeUtils.formatTimestamp(DateTimeUtils.java:764)
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)