danielcweeks commented on code in PR #17642:
URL: https://github.com/apache/iceberg/pull/17642#discussion_r4672419349
##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -5356,13 +5476,23 @@ 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.
+ It follows the same presence and precedence rules as `table-location`
in `LoadTableResult`.
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.
Review Comment:
Nit: I don't think we need the second line "Absent when the table has no
client-visible metadata location". The optional/required behavior is already
covered by the table spec and the loadTable endpoints.
<!-- lenses: weeks-review, blue-review, russell-review -->
##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -4270,13 +4354,41 @@ components:
items:
$ref: '#/components/schemas/FieldLabels'
+ TableLocation:
+ type: string
+ description:
+ The table's base location, used to resolve relative paths in metadata.
+ Must be an absolute location with a URI scheme.
+
LoadTableResult:
description: |
- 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.
- 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.
+ When present, clients can check whether metadata has changed by
comparing metadata locations.
+ To obtain a metadata location for a table that does not return one,
use the `unregisterTable` endpoint, which returns the table's last metadata
location at the point the table leaves catalog control and further commits are
rejected.
Review Comment:
I don't think we should point people at `unregisterTable` to get a metadata
location. That call takes the table out of the catalog and rejects every later
commit, and someone who just wants a pointer is going to read this as a lookup.
I'd drop this sentence, or state it as a consequence: `Clients SHOULD NOT
assume metadata-location will be present.`
<!-- lenses: russell-review -->
##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -2286,6 +2340,28 @@ components:
schema:
type: string
+ if-none-match:
+ name: If-None-Match
+ in: header
+ description:
+ An optional header that allows the server to return 304 (Not Modified)
if the metadata
+ is current.
Review Comment:
I don't think we want to fully drop the ETag sentence. It's the only place
that says what value a client sends, and moving the parameter shouldn't change
what it says. Suggest: `The content is the value of the ETag received in a
response header.`
<!-- lenses: weeks-review, blue-review, russell-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: [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]