hsiang-c commented on code in PR #12511:
URL: https://github.com/apache/iceberg/pull/12511#discussion_r1996505373


##########
core/src/main/java/org/apache/iceberg/jdbc/JdbcCatalog.java:
##########
@@ -612,6 +613,14 @@ public boolean dropView(TableIdentifier identifier) {
       throw new UnsupportedOperationException(VIEW_WARNING_LOG_MESSAGE);
     }
 
+    JdbcViewOperations ops = (JdbcViewOperations) newViewOps(identifier);
+    ViewMetadata lastViewMetadata = null;
+    try {
+      lastViewMetadata = ops.current();
+    } catch (NotFoundException e) {

Review Comment:
   `ops.current()` throws `NoSuchViewException` and `NotFoundException`.
   
   When `NoSuchViewException` is thrown, it means the view to drop doesn't 
exist. I wonder if it still makes sense to continue executing the following 
`JdbcUtil.DROP_VIEW_SQL`.
   
   When `NotFoundException` is thrown by the 
`refreshFromMetadataLocation(newMetadataLocation)` call in 
`JdbcViewOperations#doRefresh()`, it means the view exists but 
`newMetadataLocation` is not found while we try to read the metadata by 
`ViewMetadataParser.read()`. I think executing `JdbcUtil.DROP_VIEW_SQL` makes 
sense.



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

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to