pratham76 commented on code in PR #19235:
URL: https://github.com/apache/iceberg/pull/19235#discussion_r4774705165


##########
hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveCommitLocks.java:
##########
@@ -313,6 +313,37 @@ public void testLockAcquisitionAfterFailedAndFoundLock() 
throws TException, Inte
     assertThat(spyOps.current().schema().columns()).hasSize(1); // should be 1 
again
   }
 
+  @Test
+  public void testLockFailureWithShowLocksResponseWithoutLocks() throws 
TException {
+    Configuration conf = new Configuration(overriddenHiveConf);
+    conf.setLong("iceberg.hive.lock-creation-timeout-ms", 500);
+    conf.setLong("iceberg.hive.lock-creation-min-wait-ms", 10);
+    conf.setLong("iceberg.hive.lock-creation-max-wait-ms", 50);
+    HiveTableOperations shortTimeoutOps =
+        new HiveTableOperations(
+            conf,
+            spyCachedClientPool,
+            ops.io(),
+            null,
+            catalog.name(),
+            TABLE_IDENTIFIER.namespace().level(0),
+            TABLE_IDENTIFIER.name());
+
+    // Some metastores return a ShowLocksResponse without the optional locks 
field set

Review Comment:
   I hit this NPE while testing with a custom implementation of Hive Metastore, 
which returns a `ShowLocksResponse` with `locks` unset.



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