nk1506 commented on code in PR #9852:
URL: https://github.com/apache/iceberg/pull/9852#discussion_r1512646404


##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveOperationsBase.java:
##########
@@ -181,4 +264,220 @@ default Table newHmsTable(String hmsTableOwner) {
 
     return newTable;
   }
+
+  @SuppressWarnings("checkstyle:CyclomaticComplexity")
+  default void commitWithLocking(
+      Configuration conf,
+      BaseMetadata base,
+      BaseMetadata metadata,
+      String baseMetadataLocation,
+      String newMetadataLocation,
+      FileIO io) {
+    boolean newTable = base == null;
+    boolean hiveEngineEnabled = hiveEngineEnabled(conf, metadata);
+    BaseMetastoreTableOperations.CommitStatus commitStatus =
+        BaseMetastoreTableOperations.CommitStatus.FAILURE;
+    boolean updateHiveTable = false;
+    HiveLock lock = lockObject(metadata, conf, catalogName());
+    try {
+      lock.lock();
+      Table tbl = loadHmsTable();
+
+      if (tbl != null) {
+        String tableType = tbl.getTableType();
+        if (!tableType.equalsIgnoreCase(tableType().name())) {

Review Comment:
   This is needed for view test cases like 
[this](https://github.com/apache/iceberg/blob/05f99b658189e277bbf32a814ee489cf59add3fa/core/src/test/java/org/apache/iceberg/view/ViewCatalogTests.java#L293).
 



-- 
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: issues-unsubscr...@iceberg.apache.org

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


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

Reply via email to