pvary commented on code in PR #14867:
URL: https://github.com/apache/iceberg/pull/14867#discussion_r2686592560


##########
open-api/rest-catalog-open-api.py:
##########
@@ -1291,6 +1291,29 @@ class LoadTableResult(BaseModel):
     ## General Configurations
 
     - `token`: Authorization bearer token to use for table requests if OAuth2 
security is enabled
+    - `scan-planning-mode`: Controls scan planning behavior for table 
operations. This property can be configured by:
+      - **Server**: Returned in `LoadTableResponse.config()` to advertise 
server preference/requirement
+      - **Client**: Set in catalog properties to override server configuration
+
+      **Configuration Precedence**: Client config > Server config > Default 
(`client-preferred`)
+
+      **Valid values**:
+      - `client-only`: MUST use client-side planning. Fails if paired with 
server's `catalog-only`.
+      - `client-preferred` (default): Prefer client-side planning but flexible.
+      - `catalog-preferred`: Prefer server-side planning but flexible. Falls 
back to client if server doesn't support planning endpoints.
+      - `catalog-only`: MUST use server-side planning. Requires server 
support. Fails if paired with client's `client-only`.
+
+    ### Scan Planning Negotiation
+
+    When both client and server provide `scan-planning-mode` configuration, 
the final planning decision is negotiated based on the following rules:
+
+    **Negotiation Rules:**
+    - **Incompatible requirements**: `client-only` + `catalog-only` = **FAIL**
+    - **ONLY beats PREFERRED**: When one side has "ONLY" and the other has 
"PREFERRED", the ONLY requirement wins (inflexible beats flexible)
+    - **Both PREFERRED**: When both are PREFERRED (different types), client 
config wins
+    - **Both same**: When both have the same value, use that planning type
+    - **Only one configured**: Use the configured side (client or server)
+    - **Neither configured**: Use default (`client-preferred`)

Review Comment:
   The specification states:
   ```
   The corresponding file location of table metadata should be returned in the 
`metadata-location` field
   ```
   
   However, it does not specify that this location must be readable by all 
users. (Perhaps this is something we should clarify going forward.)
   
   Before the introduction of `CATALOG_ONLY` tables, users were required to 
have direct read access to the metadata files in order to plan queries on the 
table. That implied an access requirement, even though it was never explicitly 
documented. With the introduction of `CATALOG_ONLY`, this implicit requirement 
no longer applies, and we currently do not have an explicit requirement defined 
in the specification either.



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