rdblue commented on code in PR #6512:
URL: https://github.com/apache/iceberg/pull/6512#discussion_r1066003697
##########
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java:
##########
@@ -351,7 +354,30 @@ public void invalidateTable(SessionContext context,
TableIdentifier ident) {}
@Override
public Table registerTable(
SessionContext context, TableIdentifier ident, String
metadataFileLocation) {
- throw new UnsupportedOperationException("Register table is not supported");
+ checkIdentifierIsValid(ident);
+
+ Preconditions.checkArgument(
+ metadataFileLocation != null && !metadataFileLocation.isEmpty(),
+ "Cannot register an empty metadata file location as a table");
Review Comment:
If the metadata location is null, this should not state that it was empty.
Instead, use the more standard form for error messages: `"Invalid metadata file
location: %s"`. Printing the location shows that it is null or empty.
--
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]