You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/09/29 07:29:08 UTC

[GitHub] [flink] zhengcanbin commented on a change in pull request #9781: [FLINK-14098] Support multiple statements for TableEnvironment.

zhengcanbin commented on a change in pull request #9781: [FLINK-14098] Support multiple statements for TableEnvironment.
URL: https://github.com/apache/flink/pull/9781#discussion_r329341815
 
 

 ##########
 File path: flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/TableEnvironmentImpl.java
 ##########
 @@ -323,38 +324,38 @@ public void insertInto(Table table, String path, String... pathContinued) {
 
 	@Override
 	public void sqlUpdate(String stmt) {
-		List<Operation> operations = planner.parse(stmt);
-
-		if (operations.size() != 1) {
-			throw new TableException(
-				"Unsupported SQL query! sqlUpdate() only accepts a single SQL statement of type " +
-					"INSERT, CREATE TABLE, DROP TABLE");
-		}
+		Consumer<Operation> operationPreConsumer = operation -> {
 
 Review comment:
   Thanks, @wuchong . If we leave register logic in TableEnvironmentImpl, `SqlToOperationConverter#convert` would throw a ValidationException when invokes `flinkPlanner.validate` to validate DML(like `insert into t2 select ... from t2`) SqlNode because the source or sink table is not found that time. So it seems we need to consume DDL operations in advance before converting DML SqlNode to Operation. What do you think is the better solution here?

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


With regards,
Apache Git Services