docete commented on a change in pull request #11917:
URL: https://github.com/apache/flink/pull/11917#discussion_r415691459



##########
File path: 
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/TableEnvironmentImpl.java
##########
@@ -649,16 +649,32 @@ public void sqlUpdate(String stmt) {
        private TableResult executeOperation(Operation operation) {
                if (operation instanceof CreateTableOperation) {
                        CreateTableOperation createTableOperation = 
(CreateTableOperation) operation;
-                       catalogManager.createTable(
-                                       createTableOperation.getCatalogTable(),
-                                       
createTableOperation.getTableIdentifier(),
-                                       
createTableOperation.isIgnoreIfExists());
+                       if (createTableOperation.isTemporary()) {
+                               catalogManager.createTemporaryTable(
+                                               
createTableOperation.getCatalogTable(),
+                                               
createTableOperation.getTableIdentifier(),
+                                               
createTableOperation.isIgnoreIfExists());
+                       } else {
+                               catalogManager.createTable(
+                                               
createTableOperation.getCatalogTable(),
+                                               
createTableOperation.getTableIdentifier(),
+                                               
createTableOperation.isIgnoreIfExists());
+                       }
                        return TableResultImpl.TABLE_RESULT_OK;
                } else if (operation instanceof DropTableOperation) {
                        DropTableOperation dropTableOperation = 
(DropTableOperation) operation;
-                       catalogManager.dropTable(
-                                       dropTableOperation.getTableIdentifier(),
-                                       dropTableOperation.isIfExists());
+                       if (dropTableOperation.isTemporary()) {
+                               boolean dropped = 
catalogManager.dropTemporaryTable(dropTableOperation.getTableIdentifier());

Review comment:
       `TableEnvironment#dropTemporaryTable` and `dropTemporaryView` also 
return `boolean` which is consistent with `CatalogManager#dropTemporaryTable` 
and `dropTemporaryView`. Shall we refactor these interfaces in another ticket?




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


Reply via email to