kbendick commented on a change in pull request #3603:
URL: https://github.com/apache/iceberg/pull/3603#discussion_r758809728
##########
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);
Review comment:
Nit: Maybe `... falling back to only using ${FALLBACK_IMPL}`?
Something to really clarify that this is the only implementation that will
be used. Up to you if you feel it's clear enough as is (probably it is).
--
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]