@Override
  public LockType getLockType(WriteEntity writeEntity) {
    org.apache.hadoop.hive.ql.metadata.Table hmsTable = writeEntity.getTable();
    boolean sharedWrite = !HiveConf.getBoolVar(conf, ConfVars.TXN_WRITE_X_LOCK);
    // Materialized views stored by Iceberg and the MV metadata is stored in HMS doesn't need write locking because
    // the locking is done by DbTxnManager.acquireMaterializationRebuildLock()
    if (TableType.MATERIALIZED_VIEW == writeEntity.getTable().getTableType()) {
      return LockType.SHARED_READ;
    }
    if (HiveTableOperations.hiveLockEnabled(hmsTable.getParameters(), conf)) {
      throw new RuntimeException("Hive locking on table `" + hmsTable.getFullTableName() +
          "`cannot be enabled when `engine.hive.lock-enabled`=`true`. " +
          "Disable `engine.hive.lock-enabled` to use Hive locking");
    }
    switch (writeEntity.getWriteType()) {
      case INSERT_OVERWRITE:
        return LockType.EXCL_WRITE;
      case UPDATE:
      case DELETE:
        return sharedWrite ? LockType.SHARED_WRITE : LockType.EXCL_WRITE;
    }
    return LockType.SHARED_WRITE;
  }
Iceberg's optimistic concurrency control fails to provide means for IOW and Insert operations isolation.
Use `hive.txn.ext.locking.enabled` config to create Hive locks in order to guarantee data consistency.
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java