sungwy commented on code in PR #13879:
URL: https://github.com/apache/iceberg/pull/13879#discussion_r3716145795


##########
open-api/rest-catalog-open-api.py:
##########
@@ -1699,6 +1847,40 @@ class AddSchemaUpdate(BaseUpdate):
     )
 
 
+class ReadRestrictions(BaseModel):
+    """
+    Read restrictions for a table.
+    A reader evaluates the row filter against original, untransformed column 
values, then applies required-column-projections to the surviving rows. Each 
action must produce a value of the same type as the input column. If a reader 
that supports read-restrictions cannot apply any returned restriction (a filter 
expression or an action), it must fail the query and must not silently return 
raw, partial, or empty results.
+    If a projection targets a nested-typed field (struct, list, or map), other 
projections in the same ReadRestrictions must not target any nested field-id 
(struct subfields, list elements, or map keys/values) at any depth. This 
specification does not define how such actions combine. A reader that receives 
such a response must fail the query.

Review Comment:
   Previous discussion: 
https://github.com/apache/iceberg/pull/13879#discussion_r3654614778
   
   As currently written, this updated wording already requires the server to 
ensure only a single column projection exists within a nested-type field 
(struct, list, or map), while directing the client to fail if it encounters 
such a projection.
   
   Reaffirming my point from today's community sync, I believe moving in a more 
permissive direction in the future, like allowing multiple projections within 
nested fields under a spec-defined precedence rule (e.g., innermost wins), is 
safe and non-breaking. The spec can be updated independently of a catalog 
server implementation's adoption of the enhanced capability to support multiple 
projections within a nested field.
   
   My only minor feedback is to use normative RFC terminology in the spec 
description itself, for example:
   - `A server MUST NOT target a nested-field-id if a projection has already 
been applied to its parent nested-type field.`
   - `A reader that receives such a response MUST fail the query`



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