dhruvarya-db commented on code in PR #17642:
URL: https://github.com/apache/iceberg/pull/17642#discussion_r4671370139
##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -5356,13 +5482,22 @@ components:
nullable: true
CommitTableResponse:
+ description: |
+ Result used when a table is successfully updated, for tables at any
format version.
+
+
+ The `table-location` field carries the table's base location, so that
a client can resolve relative paths in the returned metadata.
type: object
required:
- - metadata-location
- metadata
properties:
metadata-location:
type: string
+ description:
+ Location of the committed table metadata file.
+ Absent when the table has no client-visible metadata location, as
for a catalog-managed table where the catalog is the source of truth for table
state.
Review Comment:
Agreed, removed it here and from the LoadTableResult descriptions as well.
##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -1145,7 +1130,15 @@ paths:
Not Modified - Based on the content of the 'If-None-Match' header
the table metadata has
not changed since.
400:
- $ref: '#/components/responses/BadRequestErrorResponse'
+ description:
+ Bad Request - The request is malformed, or the table is at a
format version that this endpoint does not serve.
Review Comment:
I went with 406 at first but ended up on 422 after Daniel's comments. The
request itself is fine, the server just can't serve this particular table
through v1. 406 in the spec is more for "this server doesn't support the
operation at all", and `loadTable` is supported here.
##########
open-api/rest-catalog-open-api.py:
##########
@@ -1939,11 +2006,35 @@ class ReadRestrictions(BaseModel):
class LoadTableResult(BaseModel):
"""
- Result used when a table is successfully loaded.
+ Result used when a table is successfully loaded, for tables at any format
version.
+
+
+ The table metadata JSON is returned in the `metadata` field.
+ The location of the table metadata file is returned in the
`metadata-location` field when the table has one, and the table's base location
in the `table-location` field.
+
+
+ ## Metadata location
+
+ The `metadata-location` field is optional.
+ It is absent when the metadata is staged but not committed, as in a create
transaction, and when the table has no client-visible metadata location, as for
a catalog-managed table where the catalog is the source of truth for table
state and no metadata pointer need exist.
- The table metadata JSON is returned in the `metadata` field. The
corresponding file location of table metadata should be returned in the
`metadata-location` field, unless the metadata is not yet committed. For
example, a create transaction may return metadata that is staged but not
committed.
- Clients can check whether metadata has changed by comparing metadata
locations after the table has been created.
+
+ Clients must not require this field to be present, and must not use it to
bypass the catalog for reads or commits.
Review Comment:
Yeah that was too strong. Removed it and brought back the upstream guidance
instead (when present, clients can compare metadata locations to detect
changes).
--
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]