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


##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -3265,6 +3265,133 @@ components:
           additionalProperties:
             type: string
 
+    ReadRestrictions:
+      type: object
+      description: >
+          Read restrictions for a table, including column projections and row 
filter expressions, according to the current schema.
+
+          A client MUST enforce the restrictions defined in this object when 
reading data
+          from the table.

Review Comment:
   That make sense !
   
   >  i'm not sure we are requring them to fail
   
   To this specifically there is a shared trust model with the admin 
designating some client as trusted, and this being totally optional for the 
catalogs to return (catalog can do some guess work based on the 
X-Client-Version header iceberg java sends) ? There is not way to tbh to 
enforce or dictate anything for older client, i understand this is a bit open 
ended but i am not fully sure if and how should we tighten it 
   
   
   > for example a planTableScan should apply all these same restrictions.
   
   Will think this a bit more as i do mention things like Query etc .... in the 
context of the apply of mask, which kind of wraps this , one way to think we 
might need a concept of session or something which is valid for the query 
execution and say all http calls originating for a query shares the session, 
will think this more !



##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -3480,6 +3480,309 @@ components:
           additionalProperties:
             type: string
 
+    ReadRestrictions:
+      type: object
+      description: >
+          Read restrictions for a table, including column projections and row 
filter expressions.
+
+          A client MUST enforce the restrictions defined in this object when 
reading data
+          from the table.
+
+          These restrictions apply only to the authenticated principal, user, 
or account
+          associated with the request. They MUST NOT be interpreted as global 
policy and
+          MUST NOT be applied beyond the entity identified by the 
Authentication header
+          (or other applicable authentication mechanism).
+
+          If both properties are absent or empty, the ReadRestrictions object 
imposes no
+          restrictions and is equivalent to the field being absent from the 
response.
+          A server MUST NOT return an action for a column whose type is not 
listed in
+          that action's "Applicable to" set.
+          For all actions, if the input column value is NULL, the output MUST 
be NULL.
+
+          If a column projection targets a struct-typed field, other column 
projections
+          in the same ReadRestrictions MUST NOT target any of that struct's 
subfields
+          (at any depth). This avoids ambiguity about which action governs a 
given
+          leaf value.
+      properties:
+        required-column-projections:
+          description: >
+            A list of columns that require specific actions to be applied when 
reading.
+
+            If this property is absent, a reader MAY access all columns of the 
table as-is
+            without any mandatory transformations.
+
+            If this property is present, each listed column MUST have its 
specified
+            action applied. Columns not listed in required-column-projections
+            are not subject to any read restrictions.
+
+            When this list is present:
+
+            1. For each column listed in required-column-projections, the 
reader MUST apply
+              the specified action before returning values for that column.
+
+            2. The reader MUST replace all output references to the column 
with the result
+              of the action, presenting the result under the original column 
name. For
+              example, if the action for column cc is mask-alphanum, the 
reader MUST
+              return the masked value as cc in the query output.
+
+            3. Columns not listed in required-column-projections MAY be 
projected normally
+              by the reader without any mandatory transformations.
+
+            4. A column MUST appear at most once in 
required-column-projections.
+
+            5. If a projected column's action cannot be evaluated by the reader
+              (including unrecognized action types), the reader MUST fail 
rather than
+              ignore or skip the action.
+
+            6. Each action defines the output type for its column. For all 
predefined
+              actions except apply-expression, the output type matches the 
input column
+              type. For apply-expression, the output type is determined by the 
expression.
+
+          type: array
+          items:
+            $ref: '#/components/schemas/Action'
+        required-row-filter:
+          description: >
+            An expression that filters rows in the table that the 
authenticated principal does not have access to.
+
+            1. The expression MUST evaluate to a boolean. A reader MUST 
discard any row for which
+              the filter evaluates to FALSE, and no information derived from 
discarded rows
+              MAY be included in the query result.
+
+            2. Row filters MUST be evaluated against the original, 
untransformed column values.
+              Required projections MUST be applied only after row filters are 
applied.
+
+            3. If a client cannot interpret or evaluate a provided filter 
expression, it MUST fail.
+
+            4. If this property is absent, null, or always true then no 
mandatory filtering is required.
+          $ref: '#/components/schemas/Expression'
+
+    Action:

Review Comment:
   Thats fair i can start moving the trasforms to the function.yaml and then 
actions and transform can be reference here ? 



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