owenmonn commented on code in PR #5722:
URL: https://github.com/apache/hive/pull/5722#discussion_r2022446177


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergMetaHook.java:
##########
@@ -422,6 +426,32 @@ public void 
preAlterTable(org.apache.hadoop.hive.metastore.api.Table hmsTable, E
     }
   }
 
+  private HiveLock lockObject(org.apache.hadoop.hive.metastore.api.Table 
hmsTable) {
+    if (hiveLockEnabled(hmsTable, conf)) {
+      return new MetastoreLock(conf, new CachedClientPool(conf, 
Maps.fromProperties(catalogProperties)),
+          catalogProperties.getProperty(Catalogs.NAME), hmsTable.getDbName(), 
hmsTable.getTableName());
+    } else {
+      return new NoLock();
+    }
+  }
+
+  private static boolean 
hiveLockEnabled(org.apache.hadoop.hive.metastore.api.Table hmsTable, 
Configuration conf) {
+    if (SessionStateUtil.getQueryState(conf).map(QueryState::getHiveOperation)
+        .filter(opType -> HiveOperation.ANALYZE_TABLE == opType)

Review Comment:
   I agree. I've fixed it. 
[a0d4c38](https://github.com/apache/hive/pull/5722/commits/a0d4c3830fe5c4c3676af0df054e0f5e6b5ce2db)



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