nssalian commented on code in PR #18800:
URL: https://github.com/apache/iceberg/pull/18800#discussion_r4474553032


##########
core/src/test/java/org/apache/iceberg/TestInternalData.java:
##########
@@ -174,6 +180,57 @@ public void 
registerToleratesExceptionInInitializerErrorOnInvoke() {
     assertThatNoException().isThrownBy(() -> 
register(ThrowsInitErrorOnInvoke.class.getName()));
   }
 
+  @Test
+  void registersParquetWhenTheContextClassLoaderCannotSeeIceberg() throws 
Exception {
+    // formats are registered once per loaded copy of InternalData, so this 
needs a fresh copy
+    try (URLClassLoader isolated =
+        new URLClassLoader(testClasspath(), 
ClassLoader.getPlatformClassLoader())) {
+      AtomicReference<Object> writeBuilder = new AtomicReference<>();
+      AtomicReference<Throwable> failure = new AtomicReference<>();
+      Thread thread =
+          new Thread(
+              () -> {
+                try {

Review Comment:
   nit: an `AssertionError` from `writeParquet` escapes this catch, so the 
failure shows as `writeBuilder` null. `catch (Throwable e)` would keep the 
cause.



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