rdblue commented on a change in pull request #3906:
URL: https://github.com/apache/iceberg/pull/3906#discussion_r786244485



##########
File path: core/src/main/java/org/apache/iceberg/avro/Avro.java
##########
@@ -553,15 +558,20 @@ public static ReadBuilder read(InputFile file) {
   public static class ReadBuilder {
     private final InputFile file;
     private final Map<String, String> renames = Maps.newLinkedHashMap();
-    private ClassLoader loader = 
Thread.currentThread().getContextClassLoader();
+    private ClassLoader loader = null;
     private NameMapping nameMapping;
     private boolean reuseContainers = false;
     private org.apache.iceberg.Schema schema = null;
     private Function<Schema, DatumReader<?>> createReaderFunc = null;
     private BiFunction<org.apache.iceberg.Schema, Schema, DatumReader<?>> 
createReaderBiFunc = null;
     private final Function<Schema, DatumReader<?>> defaultCreateReaderFunc = 
readSchema -> {
       GenericAvroReader<?> reader = new GenericAvroReader<>(readSchema);
-      reader.setClassLoader(loader);
+      ClassLoader classLoader = loader;
+      if (classLoader == null) {
+        LOG.warn("Classloader for avro reader not set, use the thread context 
classloader.");

Review comment:
       I don't think that this warning is necessary. This is a how Avro has 
always worked, so there is nothing new happening when we use the thread context 
loader.




-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to