wuchong commented on a change in pull request #15678:
URL: https://github.com/apache/flink/pull/15678#discussion_r616455314
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/windowing/assigners/SlidingEventTimeWindows.java
##########
@@ -123,9 +123,9 @@ public static SlidingEventTimeWindows of(Time size, Time
slide) {
* windows start at 0:15:00,1:15:00,2:15:00,etc.
*
* <p>Rather than that,if you are living in somewhere which is not using
UTC±00:00 time, such as
- * China which is using UTC+08:00,and you want a time window with size of
one day, and window
+ * China which is using GMT+08:00,and you want a time window with size of
one day, and window
Review comment:
revert changes to `flink-streaming-java` module.
##########
File path:
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/TableConfig.java
##########
@@ -113,6 +113,15 @@ public void setSqlDialect(SqlDialect sqlDialect) {
*/
public ZoneId getLocalTimeZone() {
String zone =
configuration.getString(TableConfigOptions.LOCAL_TIME_ZONE);
+ if (zone.startsWith("UTC+") || zone.startsWith("UTC-")) {
Review comment:
Have a shared private method for them?
##########
File path:
flink-table/flink-table-api-java/src/test/java/org/apache/flink/table/api/TableConfigTest.java
##########
@@ -63,6 +68,26 @@ public void testSetAndGetLocalTimeZone() {
assertEquals(ZoneId.of("Asia/Shanghai"),
configByConfiguration.getLocalTimeZone());
}
+ @Test
+ public void testSetInvalidLocalTimeZone() {
+ expectedException.expectMessage(
+ "The supported Zone ID is either an abbreviation such as
'PST',"
+ + " a full name such as 'America/Los_Angeles', or a
custom timezone id such as 'GMT-8:00',"
+ + " but configured Zone ID is 'UTC-10:00'.");
+ configByMethod.setLocalTimeZone(ZoneId.of("UTC-10:00"));
+ }
+
+ @Test
+ public void testGetInvalidLocalTimeZone() {
+ expectedException.expectMessage(
Review comment:
move this after `configByConfiguration.addConfiguration(configuration);`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]