singhpk234 commented on code in PR #13879:
URL: https://github.com/apache/iceberg/pull/13879#discussion_r2298790689
##########
open-api/rest-catalog-open-api.py:
##########
@@ -1240,6 +1240,24 @@ class ViewUpdate(BaseModel):
]
+class ReadRestrictions(BaseModel):
+ """
+ Read Restrictions for a table including projection and row filter
expressions. The client MUST enforce these rules to read data from the table.
If the read-restrictions section is not present or is empty, clients MUST treat
it as equivalent to having no restrictions.
+
+ """
+
+ required_projection: Optional[List[Term]] = Field(
+ None,
+ alias='required-projection',
+ description='A list of projections that must be applied before query
projections. If the term is a transform, it must replace the column referenced
by the term. For example, if the term is mask(cc, 0, 4) i.e mask transform on
column cc, it must replace the column cc in the query with the masked value,
essentially projecting it as mask(cc, 0, 4) AS cc. Readers are NOT allowed to
project columns that are not listed and must apply transforms. If the
required-projection is not present or is empty, it means that no projection is
required and all columns can be read as-is.\nNote: That each column must have
only a single projection, meaning a column can be projected as-is or as a
transformed value, but not both.\n',
Review Comment:
> Readers may ignore projections that are not explicitly requested
why do we want to say MAY here ? is this for the catalogs who don't support
column hiding policy ? my understanding was that they would populate the
columns which they don't want transformations still and wrapping things which
they need transformation on for transforms (if they support Dynamic Data
Masking).
> MAY skip transforms which aren't required for the query
Is this for the cases like lets say i want `truncate(4, col_a)` but my query
project only column_b ? do we need to be this explicit as it depends on if my
engine is smart enough to collapse the project into saying i just need
column_b, thoughts ?
--
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]