kbendick commented on a change in pull request #3603:
URL: https://github.com/apache/iceberg/pull/3603#discussion_r841006484
##########
File path: 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:
Does catching and performing work in here generate any warnings?
I _think_ that's only for returning, but checking.
--
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]