mccheah commented on a change in pull request #73: Allow data output streams to 
be generated via custom mechanisms when given partitioning and file name
URL: https://github.com/apache/incubator-iceberg/pull/73#discussion_r248072334
 
 

 ##########
 File path: 
core/src/main/java/com/netflix/iceberg/BaseMetastoreTableOperations.java
 ##########
 @@ -84,13 +75,24 @@ protected void requestRefresh() {
   }
 
   protected String writeNewMetadata(TableMetadata metadata, int version) {
-    String newTableMetadataFilePath = newTableMetadataFilePath(metadata, 
version);
-    OutputFile newMetadataLocation = 
fileIo.newOutputFile(newTableMetadataFilePath);
+    FileIO initializedFileIo = io();
+    // This would be false if the subclass overrides io() and returns a 
different kind.
+    if (initializedFileIo instanceof HadoopFileIO) {
+      ((HadoopFileIO) initializedFileIo).updateTableMetadata(metadata);
 
 Review comment:
   I built something similar to the proposed solution. The main difference is 
that now `TableOperations` has a new `io(TableMetadata)` method, which allows 
custom file IO implementations to be returned both in the case when the current 
table metadata is used and when some alternative table metadata is used. We now 
don't save the `FileIO` object as discussed earlier.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to