ajantha-bhat commented on code in PR #8909: URL: https://github.com/apache/iceberg/pull/8909#discussion_r1375740559
########## 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: Either Nessie can store all the representations or None I guess. But storing representations is not really required as global state is removed in Nessie, only view metadata location is enough. Lets see what others think. cc: @dimas-b, @snazy -- 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