nastra commented on code in PR #11960:
URL: https://github.com/apache/iceberg/pull/11960#discussion_r1914380512


##########
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java:
##########
@@ -659,9 +659,9 @@ public List<Namespace> listNamespaces(SessionContext 
context, Namespace namespac
   @Override
   public boolean namespaceExists(SessionContext context, Namespace namespace) {
     Endpoint.check(endpoints, Endpoint.V1_NAMESPACE_EXISTS);
-    checkNamespaceIsValid(namespace);
 
     try {
+      checkNamespaceIsValid(namespace);

Review Comment:
   can you please to the same for viewExists and tableExists?
   
   ```
   --- a/core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java
   +++ b/core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java
   @@ -438,9 +438,9 @@ public class RESTSessionCatalog extends 
BaseViewSessionCatalog
      @Override
      public boolean tableExists(SessionContext context, TableIdentifier 
identifier) {
        Endpoint.check(endpoints, Endpoint.V1_TABLE_EXISTS);
   -    checkIdentifierIsValid(identifier);
   
        try {
   +      checkIdentifierIsValid(identifier);
          client.head(paths.table(identifier), headers(context), 
ErrorHandlers.tableErrorHandler());
          return true;
        } catch (NoSuchTableException e) {
   @@ -659,9 +659,9 @@ public class RESTSessionCatalog extends 
BaseViewSessionCatalog
      @Override
      public boolean namespaceExists(SessionContext context, Namespace 
namespace) {
        Endpoint.check(endpoints, Endpoint.V1_NAMESPACE_EXISTS);
   -    checkNamespaceIsValid(namespace);
   
        try {
   +      checkNamespaceIsValid(namespace);
          client.head(
              paths.namespace(namespace), headers(context), 
ErrorHandlers.namespaceErrorHandler());
          return true;
   @@ -1233,9 +1233,9 @@ public class RESTSessionCatalog extends 
BaseViewSessionCatalog
      @Override
      public boolean viewExists(SessionContext context, TableIdentifier 
identifier) {
        Endpoint.check(endpoints, Endpoint.V1_VIEW_EXISTS);
   -    checkViewIdentifierIsValid(identifier);
   
        try {
   +      checkViewIdentifierIsValid(identifier);
          client.head(paths.view(identifier), headers(context), 
ErrorHandlers.viewErrorHandler());
          return true;
        } catch (NoSuchViewException e) {
   ```



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