lirui-apache commented on a change in pull request #14802:
URL: https://github.com/apache/flink/pull/14802#discussion_r567683213



##########
File path: 
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/CatalogManager.java
##########
@@ -697,6 +703,9 @@ private void dropTemporaryTableInternal(
         CatalogBaseTable catalogBaseTable = 
temporaryTables.get(objectIdentifier);
         if (filter.test(catalogBaseTable)) {
             temporaryTables.remove(objectIdentifier);
+            Optional<TemporaryOperationListener> listener =
+                    getTemporaryOperationListener(objectIdentifier);
+            listener.ifPresent(l -> 
l.onDropTemporaryTable(objectIdentifier.toObjectPath()));

Review comment:
       Actually I intentionally put `onDropTemporaryTable` after 
`temporaryTables.remove(objectIdentifier)` here. My assumption is that 
`onDropTemporaryTable` is usually the best efforts to release some kind of 
resource associated with the temp table. And if that's the case, it's better to 
release the resource after the table has been dropped. WDYT?




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