dimas-b commented on code in PR #8909:
URL: https://github.com/apache/iceberg/pull/8909#discussion_r1385587751


##########
nessie/src/main/java/org/apache/iceberg/nessie/NessieIcebergClient.java:
##########
@@ -540,4 +630,72 @@ public void close() {
       api.close();
     }
   }
+
+  public void commitView(
+      ViewMetadata base,
+      ViewMetadata metadata,
+      String newMetadataLocation,
+      String contentId,
+      ContentKey key)
+      throws NessieConflictException, NessieNotFoundException {
+    UpdateableReference updateableReference = getRef();
+
+    updateableReference.checkMutable();
+
+    Branch current = (Branch) updateableReference.getReference();
+    Branch expectedHead = current;
+    if (base != null) {
+      String metadataCommitId =
+          base.properties()
+              .getOrDefault(
+                  NessieTableOperations.NESSIE_COMMIT_ID_PROPERTY, 
expectedHead.getHash());
+      if (metadataCommitId != null) {
+        expectedHead = Branch.of(expectedHead.getName(), metadataCommitId);
+      }
+    }
+
+    long versionId = metadata.currentVersion().versionId();
+
+    ImmutableIcebergView.Builder newViewBuilder = 
ImmutableIcebergView.builder();
+    // Directly casting to `SQLViewRepresentation` as only SQL type exist in
+    // `ViewRepresentation.Type`.
+    // Assuming only one engine's dialect will be used, Nessie IcebergView 
currently holds one
+    // representation.
+    // View loaded from catalog will have all the representation as it parses 
the view metadata
+    // file.
+    SQLViewRepresentation sqlViewRepresentation =
+        (SQLViewRepresentation) 
metadata.currentVersion().representations().get(0);

Review Comment:
   Should we even bother with storing representations in Nessie at this point? 
I'd say, until Nessie supports multiple representations, we can just keep 
metadata location and ignore all representations here. These fields are 
nullable in Nessie.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to