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:
[email protected]
With regards,
Apache Git Services