rdblue commented on a change in pull request #1618:
URL: https://github.com/apache/iceberg/pull/1618#discussion_r507903601
##########
File path:
core/src/main/java/org/apache/iceberg/hadoop/HadoopTableOperations.java
##########
@@ -174,7 +176,13 @@ public void commit(TableMetadata base, TableMetadata
metadata) {
@Override
public FileIO io() {
if (defaultFileIo == null) {
- defaultFileIo = new HadoopFileIO(conf);
+ defaultFileIo = ClassLoaderUtil.fromProperty(
+ current() == null ? new HashMap<>() : current().properties(),
+ TableProperties.WRITE_FILE_IO_IMPL,
+ HadoopFileIO.class.getName(),
+ HadoopFileIO.class,
+ new Class<?>[] { Configuration.class },
+ new Object[]{ conf });
Review comment:
If you left the property handling and default classes to else blocks,
then the only value that is left is having one method with blocks to throw a
little more friendly exception messages. But the cost of that is that both the
call and the implementation are quite a bit more complicated and harder to
read. I don't really think it is worth the refactor.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]