amogh-jahagirdar commented on code in PR #17642:
URL: https://github.com/apache/iceberg/pull/17642#discussion_r4593002645


##########
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.
+    To obtain a metadata location for a catalog-managed table, 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.
+
+
+    ## Table location
+
+
+    The `table-location` field carries the table's base location.
+    Format version 4 allows location fields in metadata to be relative, and 
such paths must be resolved against the table location.
+    Format version 4 also makes `metadata.location` optional, so a table may 
have metadata that contains relative paths and omits `location`.
+    Servers must populate `table-location` for any such table, because it 
cannot be read otherwise.

Review Comment:
   cc @danielcweeks to double check this but I think `table-location` should be 
required whenever `metadata.location` is absent, not just when there are 
relative paths. Even if every path in the metadata is absolute, the table spec 
requires a table location to be provided whenever `location` is omitted



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