File tree Expand file tree Collapse file tree
core/src/main/java/com/dtstack/flink/sql/exec Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7171import java .net .URLClassLoader ;
7272import java .net .URLDecoder ;
7373import java .time .ZoneId ;
74- import java .util .Arrays ;
75- import java .util .List ;
76- import java .util .Map ;
77- import java .util .Properties ;
78- import java .util .Set ;
74+ import java .util .*;
7975
8076/**
8177 * 任务执行时的流程方法
@@ -358,11 +354,19 @@ private static StreamTableEnvironment getStreamTableEnv(StreamExecutionEnvironme
358354
359355 TableConfig tableConfig = new TableConfig ();
360356
357+ timeZoneCheck (confProperties .getProperty (TIME_ZONE ));
358+
361359 tableConfig .setLocalTimeZone (ZoneId .of (confProperties .getProperty (TIME_ZONE )));
362360
363361 StreamTableEnvironment tableEnv = StreamTableEnvironmentImpl .create (env , settings , tableConfig );
364362 StreamEnvConfigManager .streamTableEnvironmentStateTTLConfig (tableEnv , confProperties );
365363 return tableEnv ;
366364 }
367365
366+ private static void timeZoneCheck (String timeZone ) {
367+ ArrayList <String > zones = Lists .newArrayList (TimeZone .getAvailableIDs ());
368+ if (!zones .contains (timeZone )){
369+ throw new IllegalArgumentException (" timezone is Incorrect!" );
370+ }
371+ }
368372}
You can’t perform that action at this time.
0 commit comments