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


##########
core/src/main/java/org/apache/iceberg/formats/FormatModelRegistry.java:
##########
@@ -218,7 +218,11 @@ private static void registerSupportedFormats() {
   @SuppressWarnings("CatchBlockLogException")
   private static void register(String classToRegister) {
     try {
-      
DynMethods.builder("register").impl(classToRegister).buildStaticChecked().invoke();
+      DynMethods.builder("register")
+          .loader(FormatModelRegistry.class.getClassLoader())

Review Comment:
   to my understanding, this drops the context class loader completely, so if 
core is in a parent loader and format providers are in a child context loader 
they won't register anymore. should we fall back to the context loader after 
checking iceberg's loader?
   
   ```diff
          DynMethods.builder("register")
              .loader(FormatModelRegistry.class.getClassLoader())
              .impl(classToRegister)
   +          .loader(Thread.currentThread().getContextClassLoader())
   +          .impl(classToRegister)
              .buildStaticChecked()
              .invoke();
   ```
   
   keeping iceberg's loader first avoids registering into a separate copy of 
iceberg.



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