You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "deniskuzZ (via GitHub)" <gi...@apache.org> on 2023/06/08 10:07:51 UTC

[GitHub] [hive] deniskuzZ commented on a diff in pull request #4372: HIVE-27235: Iceberg:CREATE TAG SQL implementation

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


##########
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:
   could we make it reusable and extract common part in `alterTableOperation(hmsTable, alterTag/BranchSpec.getOperationType())`?



-- 
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: gitbox-unsubscribe@hive.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org