You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Write a Predicate as Iceberg expression JSON #3719
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.
Activity