rdblue commented on code in PR #3603:
URL: https://github.com/apache/iceberg/pull/3603#discussion_r841281467


##########
core/src/main/java/org/apache/iceberg/io/ResolvingFileIO.java:
##########
@@ -120,15 +118,20 @@ private FileIO io(String location) {
       try {
         io = CatalogUtil.loadFileIO(impl, properties, conf);
       } catch (IllegalArgumentException e) {
-        LOG.warn("Failed to load FileIO implementation: {}, falling back to 
{}", impl, FALLBACK_IMPL, e);
-        try {
-          // couldn't load the normal class, fall back to HadoopFileIO
-          io = CatalogUtil.loadFileIO(FALLBACK_IMPL, properties, conf);
-        } catch (IllegalArgumentException suppressed) {
-          LOG.warn("Failed to load FileIO implementation: {} (fallback)", 
FALLBACK_IMPL, suppressed);
-          // both attempts failed, throw the original exception with the later 
exception suppressed
-          e.addSuppressed(suppressed);
+        if (impl.equals(FALLBACK_IMPL)) {
+          // no implementation to fall back to, throw the exception
           throw e;
+        } else {
+          // couldn't load the normal class, fall back to HadoopFileIO
+          LOG.warn("Failed to load FileIO implementation: {}, falling back to 
{}", impl, FALLBACK_IMPL, e);
+          try {
+            io = CatalogUtil.loadFileIO(FALLBACK_IMPL, properties, conf);
+          } catch (IllegalArgumentException suppressed) {
+            LOG.warn("Failed to load FileIO implementation: {} (fallback)", 
FALLBACK_IMPL, suppressed);
+            // both attempts failed, throw the original exception with the 
later exception suppressed
+            e.addSuppressed(suppressed);
+            throw e;
+          }

Review Comment:
   I'm not quite sure what you mean



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

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

Reply via email to