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


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -763,6 +764,27 @@ public void 
alterTableBranchOperation(org.apache.hadoop.hive.ql.metadata.Table h
 
   }
 
+  @Override
+  public void alterTableTagOperation(org.apache.hadoop.hive.ql.metadata.Table 
hmsTable,
+      AlterTableTagSpec alterTagSpec) {
+    TableDesc tableDesc = Utilities.getTableDesc(hmsTable);
+    Table icebergTable = IcebergTableUtil.getTable(conf, 
tableDesc.getProperties());
+    Optional.ofNullable(icebergTable.currentSnapshot()).orElseThrow(() ->
+        new UnsupportedOperationException(String.format("Cannot alter tag on 
iceberg table" +
+            " %s.%s which has no snapshot", hmsTable.getDbName(), 
hmsTable.getTableName())));
+
+    switch (alterTagSpec.getOperationType()) {

Review Comment:
   won't simple if-else be sufficient here? same for alterTableBranchOperation



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