nastra commented on code in PR #8147:
URL: https://github.com/apache/iceberg/pull/8147#discussion_r1280345656


##########
core/src/main/java/org/apache/iceberg/MetadataUpdate.java:
##########
@@ -377,5 +408,56 @@ public String location() {
     public void applyTo(TableMetadata.Builder metadataBuilder) {
       metadataBuilder.setLocation(location);
     }
+
+    @Override
+    public void applyTo(ViewMetadata.Builder viewMetadataBuilder) {
+      viewMetadataBuilder.location(location);
+    }
+  }
+
+  class AddViewVersion implements MetadataUpdate {
+    private final ViewVersion viewVersion;
+
+    public AddViewVersion(ViewVersion viewVersion) {
+      this.viewVersion = viewVersion;
+    }
+
+    public ViewVersion viewVersion() {
+      return viewVersion;
+    }
+
+    @Override
+    public void applyTo(TableMetadata.Builder metadataBuilder) {
+      throw new UnsupportedOperationException(
+          "Adding view version to table metadata is not supported");
+    }
+
+    @Override
+    public void applyTo(ViewMetadata.Builder viewMetadataBuilder) {
+      viewMetadataBuilder.addVersion(viewVersion);
+    }
+  }
+
+  class SetCurrentViewVersion implements MetadataUpdate {
+    private final int versionId;
+
+    public SetCurrentViewVersion(int versionId) {
+      this.versionId = versionId;
+    }
+
+    public int versionId() {
+      return versionId;
+    }
+
+    @Override
+    public void applyTo(TableMetadata.Builder metadataBuilder) {
+      throw new UnsupportedOperationException(
+          "Setting current view version id for table metadata is not 
supported");
+    }
+
+    @Override
+    public void applyTo(ViewMetadata.Builder viewMetadataBuilder) {
+      viewMetadataBuilder.currentVersionId(versionId);

Review Comment:
   done



##########
core/src/main/java/org/apache/iceberg/MetadataUpdate.java:
##########
@@ -377,5 +408,56 @@ public String location() {
     public void applyTo(TableMetadata.Builder metadataBuilder) {
       metadataBuilder.setLocation(location);
     }
+
+    @Override
+    public void applyTo(ViewMetadata.Builder viewMetadataBuilder) {
+      viewMetadataBuilder.location(location);

Review Comment:
   done



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

Reply via email to