ajantha-bhat commented on code in PR #8909:
URL: https://github.com/apache/iceberg/pull/8909#discussion_r1374101581


##########
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:
   Currently Nessie's `IcebergView` model stores only one dialect and 
representation. I didn't change Nessie side to hold multiple representation 
because it was needed for _global state_. Now that `global state` is removed in 
Nessie, only view metadata location  is enough. It will have current version id 
and all the representation for that version. 



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