deniskuzZ commented on code in PR #14236:
URL: https://github.com/apache/iceberg/pull/14236#discussion_r2437343962


##########
hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveCommits.java:
##########
@@ -504,6 +507,52 @@ public void testChangeLockWithAlterTable() throws 
Exception {
         .hasSameClassAs(initialLock);
   }
 
+  @ParameterizedTest
+  @ValueSource(booleans = {true, false})
+  public void testFirstHiveCommitWithLockSetting(boolean lockEnabled) {
+    String tableName = lockEnabled ? "new_table_with_lock" : 
"new_table_with_no_lock";
+    TableIdentifier newTableIdentifier = TableIdentifier.of(DB_NAME, 
tableName);
+
+    try {
+      HiveTableOperations ops =
+          new HiveTableOperations(
+              catalog.getConf(),
+              catalog.clientPool(),
+              catalog.newTableOps(newTableIdentifier).io(),
+              catalog.name(),
+              newTableIdentifier.namespace().level(0),
+              newTableIdentifier.name());
+
+      AtomicReference<HiveLock> lockRef = new AtomicReference<>();
+      HiveTableOperations spyOps = spy(ops);
+      TableMetadata metadata =
+          TableMetadata.newTableMetadata(
+              SCHEMA,
+              PartitionSpec.unpartitioned(),
+              catalog.defaultWarehouseLocation(newTableIdentifier),
+              lockEnabled ? ImmutableMap.of() : 
ImmutableMap.of(HIVE_LOCK_ENABLED, "false"));

Review Comment:
   minor, why not be explicit: `ImmutableMap.of(HIVE_LOCK_ENABLED, 
String.valueOf(lockEnabled)`



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to