ajantha-bhat commented on code in PR #8909: URL: https://github.com/apache/iceberg/pull/8909#discussion_r1400469049
########## 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: Aah, `SqlText` is not nullable. So, I cannot construct without it. I will raise a PR at Nessie side to make it Nullable. https://github.com/projectnessie/nessie/blob/fff9154da6a19cf289c09f2996b75f3cd15e0ca0/api/model/src/main/java/org/projectnessie/model/IcebergView.java#L56 -- 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