Skip to content

Write a Predicate as Iceberg expression JSON #3719

Open

Description

@mbutrovich

Is your feature request related to a problem or challenge?

The REST scan planning client (#1690) sends the scan filter as expression JSON in the filter field of PlanTableScanRequest (OpenAPI). iceberg-rust can't write it. #2656 had a pub(crate) writer in iceberg-catalog-rest that dropped the filter for temporal, decimal, binary, and uuid literals.

Describe the solution you'd like

Add Predicate::try_into_json, the counterpart of Predicate::try_from_json from #3718, named after Literal::try_into_json. It converts the predicate to the expression types from #3718 and writes literals with Literal::try_into_json, so every primitive type round-trips.

The caller passes the JSON form, the spec form or the deprecated term-based form, as an enum argument. The REST client needs the deprecated form today. Java REST services parse request filters with ExpressionParser (PlanTableScanRequestParser.java#L118), which on main reads only that form (ExpressionParser.java#L321). Once services accept the spec form (apache/iceberg#17343 adds it to Java), the client switches by changing its argument. An implicit default would make that switch a silent change in behavior for every caller, which is a breaking change that public-api.txt doesn't show. v4 metadata writes the spec form through the pub(crate) types and doesn't need this method.

Tests write every operator and a literal of every primitive type in both forms, and check that Predicate::try_from_json reads each back unchanged.

Willingness to contribute

I can contribute to this feature independently

Activity

  1. self-assigned this
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions