bowenli86 commented on a change in pull request #10272: [FLINK-14878]Support 
`use  catalog` through sqlUpdate() method in TableEnvironment
URL: https://github.com/apache/flink/pull/10272#discussion_r348698869
 
 

 ##########
 File path: 
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/TableEnvironmentImpl.java
 ##########
 @@ -473,7 +474,11 @@ public void sqlUpdate(String stmt) {
                        catalogManager.dropTable(
                                dropTableOperation.getTableIdentifier(),
                                dropTableOperation.isIfExists());
-               } else {
+               } else if (operation instanceof UseCatalogOperation) {
+                       UseCatalogOperation useCatalogOperation = 
(UseCatalogOperation) operation;
+                       
catalogManager.setCurrentCatalog(useCatalogOperation.getCatalogName());
+               }
+               else {
                        throw new TableException(
                                "Unsupported SQL query! sqlUpdate() only 
accepts a single SQL statements of " +
                                        "type INSERT, CREATE TABLE, DROP 
TABLE");
 
 Review comment:
   deos this need to be updated?

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