yabola commented on code in PR #5510:
URL: https://github.com/apache/iceberg/pull/5510#discussion_r950668615


##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java:
##########
@@ -169,9 +170,14 @@ public boolean dropTable(TableIdentifier identifier, 
boolean purge) {
 
     TableOperations ops = newTableOps(identifier);
     TableMetadata lastMetadata;
-    if (purge && ops.current() != null) {
-      lastMetadata = ops.current();
-    } else {
+    try {
+      if (purge && ops.current() != null) {
+        lastMetadata = ops.current();
+      } else {
+        lastMetadata = null;

Review Comment:
   It is better to initialize to null from the concise code, but I think 
keeping null is easier to understand in terms of readability.  
   I think It depends on whether the `lastMetadata = null` has a significant 
effect on the method . If it is not that important, we can initialise it as 
null.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to