[
https://issues.apache.org/jira/browse/FLINK-22525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17337156#comment-17337156
]
Leonard Xu edited comment on FLINK-22525 at 4/30/21, 7:50 AM:
--------------------------------------------------------------
[~frank wang], we check the zone Id because the *java.util.TimeZone* can not
parse zone Id format like 'UTC+8', we used this conversion internal, the
*java.time.ZoneId* actually support this format.
{code:java}
@Test
public void testTimeZoneParse() {
System.out.println(ZoneId.of("UTC+8") + " " +
TimeZone.getTimeZone("UTC+8"));
System.out.println(ZoneId.of("GMT+08:00") + " " +
TimeZone.getTimeZone("GMT+08:00"));
}
UTC+08:00
sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
GMT+08:00
sun.util.calendar.ZoneInfo[id="GMT+08:00",offset=28800000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
{code}
was (Author: leonard xu):
[~frank wang], we check the zone id is because the *java.util.TimeZone* can not
parse zoneId format like 'UTC+8', we used this conversion internal, the ZoneId
actually support this format.
{code:java}
@Test
public void testTimeZoneParse() {
System.out.println(ZoneId.of("UTC+8") + " " +
TimeZone.getTimeZone("UTC+8"));
System.out.println(ZoneId.of("GMT+08:00") + " " +
TimeZone.getTimeZone("GMT+08:00"));
}
UTC+08:00
sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
GMT+08:00
sun.util.calendar.ZoneInfo[id="GMT+08:00",offset=28800000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
{code}
> The zone id in exception message should be GMT+08:00 instead of GMT+8:00
> ------------------------------------------------------------------------
>
> Key: FLINK-22525
> URL: https://issues.apache.org/jira/browse/FLINK-22525
> Project: Flink
> Issue Type: Bug
> Components: Documentation, Table SQL / API
> Affects Versions: 1.13.0
> Reporter: Leonard Xu
> Priority: Minor
> Fix For: 1.14.0, 1.13.1
>
>
> {code:java}
> Flink SQL> SET table.local-time-zone=UTC+3;
> Flink SQL> select current_row_timestamp();
> [ERROR] Could not execute SQL statement. Reason:
> java.lang.IllegalArgumentException: The supported Zone ID is either a full
> name such as 'America/Los_Angeles', or a custom timezone id such as
> 'GMT-8:00', but configured Zone ID is 'UTC+3'.
> {code}
> The valid zoned should be 'GMT-08:00'
--
This message was sent by Atlassian Jira
(v8.3.4#803005)