You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/03/19 09:09:13 UTC

[GitHub] [iceberg] marton-bod commented on a change in pull request #2340: Hive: Remove unnecessary SerializationUtil.serializeToBase64 from HiveIcebergStorageHandler.overlayTableProperties

marton-bod commented on a change in pull request #2340:
URL: https://github.com/apache/iceberg/pull/2340#discussion_r597512668



##########
File path: core/src/main/java/org/apache/iceberg/StaticTableOperations.java
##########
@@ -29,24 +29,37 @@
  * and cannot be used to create or delete files.
  */
 public class StaticTableOperations implements TableOperations {
-  private final TableMetadata staticMetadata;
+  private TableMetadata staticMetadata;
+  private final String metadataFileLocation;
   private final FileIO io;
+  private final LocationProvider locationProvider;
 
   /**
    * Creates a StaticTableOperations tied to a specific static version of the TableMetadata
    */
   public StaticTableOperations(String metadataFileLocation, FileIO io) {
+    this(metadataFileLocation, io, null);
+  }
+
+  public StaticTableOperations(String metadataFileLocation, FileIO io, LocationProvider locationProvider) {
     this.io = io;
-    this.staticMetadata = TableMetadataParser.read(io, metadataFileLocation);
+    this.metadataFileLocation = metadataFileLocation;
+    this.locationProvider = locationProvider;
   }
 
   @Override
   public TableMetadata current() {
+    if (staticMetadata == null) {
+      staticMetadata = TableMetadataParser.read(io, metadataFileLocation);
+    }
     return staticMetadata;
   }
 
   @Override
   public TableMetadata refresh() {
+    if (staticMetadata == null) {

Review comment:
       Also, I was thinking that not refreshing the metadata on calling `refresh()` might come as a surprise for users. Do we want to either throw unsupported operation exc (probably not preferable), or at least add some short javadoc explaining why the refresh() works differently here than for the other table operations? We might even simply call `current()` here to make it clear it's the same behaviour. Let me know what you guys think




-- 
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:
users@infra.apache.org



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