Skip to content

Open API: [4/N] Add RCK tests for ReadRestrictions - #17809

Open
singhpk234 wants to merge 12 commits into
apache:mainfrom
singhpk234:feature/rck-read-restrictions
Open

singhpk234 wants to merge 12 commits into
apache:mainfrom
singhpk234:feature/rck-read-restrictions

Conversation

@singhpk234

@singhpk234 singhpk234 commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Adds REST Compatibility Kit coverage for the read-restrictions field on loadTable. The test server injects a mask-to-fixed-value projection for tables in a configured namespace, and the tests check that the client carries it onto the loaded table through SupportsReadRestrictions with the right field ID and function, and that tables outside that namespace load with no restrictions. Servers that don't support read restrictions can opt out with rck.supports-read-restrictions=false. Stacked on #16131; review only open-api/src/test and open-api/src/testFixtures.

@github-actions

Copy link
Copy Markdown

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.

Adds FunctionReference and UnboundApply, and Expressions factory methods
to build function application terms from the expressions spec.
Serializes predicates in the form defined in format/expressions-spec.md,
including apply terms and field-id references, while continuing to accept
the deprecated term-based form.
Keeps the original structure of the unbound predicate writer, stores
apply arguments in an array so the class is Kryo serializable, and splits
the null-catalog function reference check into its own test.

Generated-by: Claude Code
Adds BoundApply so that an UnboundApply with a known result type can be
bound by binding each of its arguments. Bound applies can be written to
JSON and unbound. Applies without a result type, such as those read from
JSON, still cannot be bound.

Generated-by: Claude Code
The expressions spec defines partition transforms as functions in the
iceberg_functions catalog, and a function reference without a catalog
refers to the catalog of the referencing object. Only read applies as
transforms when they use the iceberg_functions catalog, and write
transforms with it.

Generated-by: Claude Code
The expressions spec defines partition transforms as functions in the
iceberg_functions catalog. UnboundTransform and BoundTransform now extend
UnboundApply and BoundApply, so the parser writes them through the same
path as other function applications.

Generated-by: Claude Code
Removes Expressions.apply and makes UnboundApply.arguments package-private
so function arguments typed as Object are not public API until a function
argument type exists. Stores function reference identifiers in an array
for Kryo, and trims redundant comments and code.

Generated-by: Claude Code
Adds the org.apache.iceberg.functions package, the engine-side Java API for
the column projection actions defined by the ReadRestrictions spec. Each
function takes a column value and applies a masking or transformation
operation. UnknownFunction parses unrecognized action names and fails closed
at bind time.
Make IcebergFunction a column-agnostic definition that binds to a type,
following Transform and Transforms: implementations are package-private
singletons reached through IcebergFunctions, toString() returns the
function name, and serialization proxies keep the singletons unique. The
field id is removed so callers pair a function with a column, as
PartitionField does with a transform. Function names use snake_case.

Factories return functions whose input and output types match, as the
spec requires actions to preserve the column type, and string functions
accept any CharSequence, Iceberg's representation for strings.

Also fix mask_to_fixed_value accepting structs whose fields it cannot
mask, and its bound functions for binary and fixed values not being
serializable.

Generated-by: Claude Code
Carry the per-principal read restrictions from REST load, create, and
register responses on the loaded table, and validate that every column
projection targets a field id present in the table's schemas.

Row filter references are field ids per the spec, so they are resolved
against the schema in the same response; a filter that cannot be
resolved fails the load rather than being dropped.

Builds on the column-agnostic IcebergFunction API: an Action pairs a
function with the field id it applies to, matching the spec's Action
shape. Client-side enforcement in the data module is left to a
follow-up.

Generated-by: Claude Code
@singhpk234 singhpk234 changed the title Open API: RCK for ReadRestrictions Open API: [4/N] Add RCK tests for ReadRestrictions Oct 23, 2026
Add REST Compatibility Kit tests that validate the read-restrictions
wire format round-trip through LoadTableResponse. The server adapter
injects a mask-to-fixed-value restriction for tables in a configured
namespace, and the tests verify the restriction is propagated to the
loaded table via SupportsReadRestrictions, and that tables outside that
namespace load without restrictions.

Generated-by: Claude Code
@sfc-gh-prsingh
sfc-gh-prsingh force-pushed the feature/rck-read-restrictions branch from ce6392e to fc0d86a Compare October 23, 2026 02:29
@singhpk234 singhpk234 moved this from Todo to In Progress in [REST] Read Restrictions Oct 23, 2026
@singhpk234
singhpk234 marked this pull request as ready for review October 23, 2026 02:33

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants