wuchong commented on a change in pull request #14802:
URL: https://github.com/apache/flink/pull/14802#discussion_r567700470



##########
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:
       I think we should keep the behavior consistent for onCreate and onDrop, 
different connectors may have different needs on the listener, is there any 
connectors must do something before the temporary table is dropped? 
   
   We can explicitly document the behavior in javadocs that all the methods are 
invoked before temporary object is registered/unregistered, and any thrown 
exception will prevent the registering/unregistering.
   
   If we have any best effort logic, they can catch the exception instead of 
throwing it in the connectors's implementation. 




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