You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "dramaticlly (via GitHub)" <gi...@apache.org> on 2023/09/15 18:20:21 UTC

[GitHub] [iceberg] dramaticlly opened a new pull request, #8569: open-api: Add namespaceExist API

dramaticlly opened a new pull request, #8569:
URL: https://github.com/apache/iceberg/pull/8569

   Add a new namespaceExists API which are HEAD http call to namespace resources, it's similar to tableExists API already defined in open-api spec.
   
   This is spec change only as I dont think we need to change any part of the code in rest package, since both [tableExists](https://github.com/apache/iceberg/blob/cf32bdead13815daf26c9feceebc6cd606a7bab8/api/src/main/java/org/apache/iceberg/catalog/SessionCatalog.java#L180-L187) and [namespaceExists](https://github.com/apache/iceberg/blob/cf32bdead13815daf26c9feceebc6cd606a7bab8/api/src/main/java/org/apache/iceberg/catalog/SessionCatalog.java#L356-L363) and defined as default method in SessionCatalog interface.
   
   `make lint && make generate` are happy
   
   Can you guys take a look? @Fokko @nastra @rdblue
   
   CC @haizhou-zhao


-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] dramaticlly commented on a diff in pull request #8569: open-api: Add namespaceExist API

Posted by "dramaticlly (via GitHub)" <gi...@apache.org>.
dramaticlly commented on code in PR #8569:
URL: https://github.com/apache/iceberg/pull/8569#discussion_r1330762911


##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -313,6 +313,29 @@ paths:
         5XX:
           $ref: '#/components/responses/ServerErrorResponse'
 
+    head:
+      tags:
+        - Catalog API
+      summary: Check if a namespace exists
+      operationId: namespaceExists
+      description:
+        Check if a namespaces exists. This request does not return a response body.

Review Comment:
   updated to `Check if a namespace exists. This response does not return a body.`



-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] open-api: Add namespaceExist API [iceberg]

Posted by "Fokko (via GitHub)" <gi...@apache.org>.
Fokko commented on PR #8569:
URL: https://github.com/apache/iceberg/pull/8569#issuecomment-1743609595

   Fair point, let's add this. Thanks @nastra and @amogh-jahagirdar for the reviews, and @dramaticlly for raising this PR!


-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] dramaticlly commented on pull request #8569: open-api: Add namespaceExist API

Posted by "dramaticlly (via GitHub)" <gi...@apache.org>.
dramaticlly commented on PR #8569:
URL: https://github.com/apache/iceberg/pull/8569#issuecomment-1730512405

   @Fokko @amogh-jahagirdar can you take a look when you had a chance?


-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] open-api: Add namespaceExist API [iceberg]

Posted by "Fokko (via GitHub)" <gi...@apache.org>.
Fokko merged PR #8569:
URL: https://github.com/apache/iceberg/pull/8569


-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] open-api: Add namespaceExist API [iceberg]

Posted by "dramaticlly (via GitHub)" <gi...@apache.org>.
dramaticlly commented on PR #8569:
URL: https://github.com/apache/iceberg/pull/8569#issuecomment-1743604553

   > Sorry for being so late to the party. I don't have a strong objection against this, but I'm curious about what the use case is. If you want to create a namespace then it is best to just try to create it, and catch the exception. If you check, and then create, then a race condition might occur. You still need to handle the exception in case the namespace has been created between the check and the creation.
   
   Thank you Fokko! I guess my motivation is simply to have feature parity between namespace and table on REST APIs. So our use case is not really do check before create, as Head call on namespace resource provide ability to check existence of namespace without provide explicit namespace matdadata like properties (even though today in our default implementation it's similar to loadNamespace and return true if it can be loaded)


-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] open-api: Add namespaceExist API [iceberg]

Posted by "Fokko (via GitHub)" <gi...@apache.org>.
Fokko commented on PR #8569:
URL: https://github.com/apache/iceberg/pull/8569#issuecomment-1743585167

   Sorry for being so late to the party. I don't have a strong objection against this, but I'm curious about what the use case is. If you want to create a namespace then it is best to just try to create it, and catch the exception. If you check, and then create, then a race condition might occur. You still need to handle the exception in case the namespace has been created between the check and the creation.


-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] open-api: Add namespaceExist API [iceberg]

Posted by "dramaticlly (via GitHub)" <gi...@apache.org>.
dramaticlly commented on PR #8569:
URL: https://github.com/apache/iceberg/pull/8569#issuecomment-1743610048

   thank you @Fokko, @amogh-jahagirdar and @nastra for the review!


-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] nastra commented on a diff in pull request #8569: open-api: Add namespaceExist API

Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #8569:
URL: https://github.com/apache/iceberg/pull/8569#discussion_r1330209510


##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -313,6 +313,29 @@ paths:
         5XX:
           $ref: '#/components/responses/ServerErrorResponse'
 
+    head:
+      tags:
+        - Catalog API
+      summary: Check if a namespace exists
+      operationId: namespaceExists
+      description:
+        Check if a namespaces exists. This request does not return a response body.

Review Comment:
   should this say that the response doesn't return a body instead of the request?



##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -313,6 +313,29 @@ paths:
         5XX:
           $ref: '#/components/responses/ServerErrorResponse'
 
+    head:
+      tags:
+        - Catalog API
+      summary: Check if a namespace exists
+      operationId: namespaceExists
+      description:
+        Check if a namespaces exists. This request does not return a response body.
+      responses:
+        204:
+          description: Success, no content
+        400:

Review Comment:
   ```
           400:
             $ref: '#/components/responses/BadRequestErrorResponse'
           401:
             $ref: '#/components/responses/UnauthorizedResponse'
           403:
             $ref: '#/components/responses/ForbiddenResponse'
           404:
             description: Not Found - Namespace not found
             content:
               application/json:
                 schema:
                   $ref: '#/components/schemas/ErrorModel'
                 examples:
                   NoSuchNamespaceExample:
                     $ref: '#/components/examples/NoSuchNamespaceError'
   ```



-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] dramaticlly commented on a diff in pull request #8569: open-api: Add namespaceExist API

Posted by "dramaticlly (via GitHub)" <gi...@apache.org>.
dramaticlly commented on code in PR #8569:
URL: https://github.com/apache/iceberg/pull/8569#discussion_r1330764916


##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -313,6 +313,29 @@ paths:
         5XX:
           $ref: '#/components/responses/ServerErrorResponse'
 
+    head:
+      tags:
+        - Catalog API
+      summary: Check if a namespace exists
+      operationId: namespaceExists
+      description:
+        Check if a namespaces exists. This request does not return a response body.
+      responses:
+        204:
+          description: Success, no content
+        400:

Review Comment:
   thank you, I originally copy this from tableExists API and managed to update what you suggested on both APIs



-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] dramaticlly commented on a diff in pull request #8569: open-api: Add namespaceExist API

Posted by "dramaticlly (via GitHub)" <gi...@apache.org>.
dramaticlly commented on code in PR #8569:
URL: https://github.com/apache/iceberg/pull/8569#discussion_r1334637755


##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -777,16 +809,26 @@ paths:
       summary: Check if a table exists
       operationId: tableExists
       description:
-        Check if a table exists within a given namespace. This request does not return a response body.
+        Check if a table exists within a given namespace. This response does not return a body.

Review Comment:
   thank you @amogh-jahagirdar , reword as suggested



-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] amogh-jahagirdar commented on a diff in pull request #8569: open-api: Add namespaceExist API

Posted by "amogh-jahagirdar (via GitHub)" <gi...@apache.org>.
amogh-jahagirdar commented on code in PR #8569:
URL: https://github.com/apache/iceberg/pull/8569#discussion_r1334628584


##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -777,16 +809,26 @@ paths:
       summary: Check if a table exists
       operationId: tableExists
       description:
-        Check if a table exists within a given namespace. This request does not return a response body.
+        Check if a table exists within a given namespace. This response does not return a body.

Review Comment:
   Thanks for fixing this, just a nit: `The response does not contain a body`



-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


[GitHub] [iceberg] dramaticlly commented on pull request #8569: open-api: Add namespaceExist API

Posted by "dramaticlly (via GitHub)" <gi...@apache.org>.
dramaticlly commented on PR #8569:
URL: https://github.com/apache/iceberg/pull/8569#issuecomment-1734103018

   thank you @amogh-jahagirdar and @nastra for the review! I guess @Fokko is the last approval needed to merge the change, right?


-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org