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


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/IcebergTagExec.java:
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iceberg.mr.hive;
+
+import org.apache.hadoop.hive.ql.parse.AlterTableTagSpec;
+import org.apache.iceberg.ManageSnapshots;
+import org.apache.iceberg.Table;
+import org.apache.iceberg.util.SnapshotUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class IcebergTagExec {
+
+  private static final Logger LOG = 
LoggerFactory.getLogger(IcebergTagExec.class);
+
+  private IcebergTagExec() {
+  }
+
+  public static void createTag(Table table, AlterTableTagSpec.CreateTagSpec 
createBranchSpec) {

Review Comment:
   The main difference is that `create tag` operation needs less fields, e.g. 
`minSnapshotsToKeep `and `maxSnapshotAgeMs`. But as the final code execution 
stage, i want to keep the two separate to make code more cleaner.
   
   In this commit 
https://github.com/apache/hive/pull/4372/commits/6ef586f028f1d14a7cfbb21fef5b881d48d694a8,
 I also try my best to reuse code. Especilly, i reused one method 
`Hive::alterTableMetaRefOperation` & 
`HiveStorageHandler::alterTableMetaRefOperation` to operate tag&branch.



-- 
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-unsubscr...@hive.apache.org

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


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

Reply via email to