ajantha-bhat commented on code in PR #14868:
URL: https://github.com/apache/iceberg/pull/14868#discussion_r2693234813
##########
core/src/main/java/org/apache/iceberg/view/BaseMetastoreViewCatalog.java:
##########
@@ -298,4 +299,28 @@ public Transaction replaceTransaction() {
return super.replaceTransaction();
}
}
+
+ @Override
+ public View registerView(TableIdentifier identifier, String
metadataFileLocation) {
+ Preconditions.checkArgument(
+ identifier != null && isValidIdentifier(identifier), "Invalid
identifier: %s", identifier);
+ Preconditions.checkArgument(
+ metadataFileLocation != null && !metadataFileLocation.isEmpty(),
+ "Cannot register an empty metadata file location as a view");
+
+ if (viewExists(identifier)) {
+ throw new AlreadyExistsException("View already exists: %s", identifier);
+ }
+
+ if (tableExists(identifier)) {
+ throw new AlreadyExistsException("Table with same name already exists:
%s", identifier);
+ }
+
+ ViewOperations ops = newViewOps(identifier);
+ InputFile metadataFile = ((BaseViewOperations)
ops).io().newInputFile(metadataFileLocation);
+ ViewMetadata metadata = ViewMetadataParser.read(metadataFile);
Review Comment:
added and used it in all existing places.
--
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]