wuchong commented on a change in pull request #11296: [FLINK-16363] [table] 
Correct the execution behavior of TableEnvironment and StreamTableEnvironment
URL: https://github.com/apache/flink/pull/11296#discussion_r388764758
 
 

 ##########
 File path: 
flink-table/flink-table-api-java-bridge/src/main/java/org/apache/flink/table/api/java/internal/StreamTableEnvironmentImpl.java
 ##########
 @@ -357,6 +361,26 @@ public StreamExecutionEnvironment execEnv() {
                return executionEnvironment;
        }
 
+       /**
+        * This method is used for sql client to submit job.
+        */
+       public Pipeline getPipeline(String jobName) {
+               return execEnv.createPipeline(translate(), tableConfig, 
jobName);
+       }
+
+       @Override
+       protected List<Transformation<?>> translate(List<ModifyOperation> 
modifyOperations) {
+               // keep the behavior as before: translate each operation 
independently
+               List<Transformation<?>> transformations = new 
ArrayList<>(modifyOperations.size());
+               for (ModifyOperation operation : modifyOperations) {
+                       List<Transformation<?>> transformationList = 
planner.translate(Collections.singletonList(operation));
+                       Preconditions.checkArgument(transformationList.size() 
== 1,
+                               "expected size is 1, actual size is " + 
transformationList.size());
+                       transformations.add(transformationList.get(0));
+               }
 
 Review comment:
   It seems that `StreamTableEnvironmentImpl` forces to disable multi-sink 
optimization which is a  pity for users. I think multi-sink optimization is 
just an optimization and doesn't change affect the result, so we can allow 
multi-sink optimization for `StreamTableEnvironment`. That would be a good news 
for users. 

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to