jackye1995 commented on a change in pull request #1618:
URL: https://github.com/apache/iceberg/pull/1618#discussion_r509800216



##########
File path: 
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveTableOperations.java
##########
@@ -108,7 +108,8 @@ protected String tableName() {
   @Override
   public FileIO io() {
     if (fileIO == null) {
-      fileIO = new HadoopFileIO(conf);
+      // avoid refresh metadata because refresh() calls io() again
+      fileIO = CatalogUtil.loadFileIO(getCurrentMetadataNoRefresh(), conf);

Review comment:
       Yeah I am also just thinking about the loop issue. If someone creates a 
new table and then reuse the same `TableOperations` object then it will 
continue to use the default `FileIO` and it would be a problem. However, 
`refresh` calls `refreshFromMetadataLocation` and that in the end has to call 
`io` to get all the metadata.




----------------------------------------------------------------
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]

Reply via email to