KurtYoung commented on a change in pull request #9761: 
[FLINK-14031][examples][table]Added the blink planner dependency and …
URL: https://github.com/apache/flink/pull/9761#discussion_r327914739
 
 

 ##########
 File path: 
flink-examples/flink-examples-table/src/main/java/org/apache/flink/table/examples/java/StreamSQLExample.java
 ##########
 @@ -42,9 +47,24 @@
 
        public static void main(String[] args) throws Exception {
 
+               final ParameterTool params = ParameterTool.fromArgs(args);
+               String planner = params.has("planner") ? params.get("planner") 
: "flink";
+
                // set up execution environment
                StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment();
-               StreamTableEnvironment tEnv = 
StreamTableEnvironment.create(env);
+               StreamTableEnvironment tEnv;
+               if (Objects.equals(planner, "blink")) { // use blink planner in 
streaming mode
+                       EnvironmentSettings settings = 
EnvironmentSettings.newInstance()
+                               .useBlinkPlanner()
+                               .inStreamingMode()
+                               .build();
+                       tEnv = StreamTableEnvironment.create(env, settings);
+               } else if (Objects.equals(planner, "flink")){   // use flink 
planner in streaming mode
+                       tEnv = StreamTableEnvironment.create(env);
+               } else {
+                       System.err.println("The planner is incorrect. Please 
use --planner to specify planner type.");
 
 Review comment:
   The user will not have such knowledge when they are trying the examples 
without looking into the codes. 

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to