deniskuzZ commented on code in PR #5404:
URL: https://github.com/apache/hive/pull/5404#discussion_r1728543323


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -1011,10 +1011,13 @@ public void 
alterTableSnapshotRefOperation(org.apache.hadoop.hive.ql.metadata.Ta
         IcebergSnapshotRefExec.createBranch(icebergTable, createBranchSpec);
         break;
       case CREATE_TAG:
-        Optional.ofNullable(icebergTable.currentSnapshot()).orElseThrow(() -> 
new UnsupportedOperationException(
-            String.format("Cannot alter %s on iceberg table %s.%s which has no 
snapshot",
-                alterTableSnapshotRefSpec.getOperationType().getName(), 
hmsTable.getDbName(),
-                hmsTable.getTableName())));
+        // https://errorprone.info/bugpattern/ReturnValueIgnored
+        if (!Optional.ofNullable(icebergTable.currentSnapshot()).isPresent()) {

Review Comment:
   i think it's much more straightforward just to compare with 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