xndai commented on code in PR #16400:
URL: https://github.com/apache/iceberg/pull/16400#discussion_r3278264214


##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -1217,6 +1217,56 @@ paths:
         5XX:
           $ref: '#/components/responses/ServerErrorResponse'
 
+  /v1/{prefix}/namespaces/{namespace}/tables/{table}/unregister:
+    parameters:
+      - $ref: '#/components/parameters/prefix'
+      - $ref: '#/components/parameters/namespace'
+      - $ref: '#/components/parameters/table'
+
+    post:
+      tags:
+        - Catalog API
+      summary: Unregister a table without removing its data or metadata files
+      operationId: unregisterTable
+      parameters:
+        - $ref: '#/components/parameters/idempotency-key'
+      description:
+        Unregister a table from the catalog. This is the opposite of
+        `registerTable`. The table no longer exists in the catalog, but the
+        underlying data and metadata files are left in place so that the table
+        can be registered in another catalog.

Review Comment:
   An interesting experiment using Claude and the latest mainline. If LLM is 
confused, I bet many human, and human who use LLMs, would be confused too. 
   
   ```
     Read rest-catalog-open-api.yaml carefully. Now if I want to implement 
'DROP TABLE' for a query
       engine, which only removes the table entry from catalog, but not the 
data and metadata on cloud storage, which IRC interface should I use, what 
parameters should be set?
   
     Searched for 1 pattern, read 1 file (ctrl+o to expand)
   
   ● You should use the DELETE 
/v1/{prefix}/namespaces/{namespace}/tables/{table} endpoint (operation: 
dropTable).
   
     To only remove the catalog entry without purging data and metadata on 
storage, set the query parameter:
   
     purgeRequested=false
   
     This is also the default (default: false), so you can simply omit the 
parameter entirely. The request would look like:
   
     DELETE /v1/{prefix}/namespaces/{namespace}/tables/{table}
   
     A successful response returns 204 No Content.
   
     The key distinction: when purgeRequested=true, the catalog is asked to 
also delete the underlying data and metadata files. When false (or
     omitted), only the catalog entry is removed — the files on cloud storage 
remain intact.
   
   ✻ Baked for 15s
   ```



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

Reply via email to