mbutrovich opened a new issue, #3719: URL: https://github.com/apache/iceberg-rust/issues/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](https://github.com/apache/iceberg/blob/13135ae08148b010276fc9c5eb1cfbf2e6e8289c/open-api/rest-catalog-open-api.yaml#L5782-L5797)). 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`](https://github.com/apache/iceberg-rust/blob/641f59049e0aefad0c60e19915ecdb54933e002f/crates/iceberg/src/spec/values/literal.rs#L621). 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`](https://github.com/apache/iceberg/blob/13135ae08148b010276fc9c5eb1cfbf2e6e8289c/core/src/main/java/org/apache/iceberg/rest/requests/PlanTableScanRequestParser.java#L118)), which on `main` reads only that form ([`ExpressionParser.java#L321`](https://github.com/apache/iceberg/blob/13135ae08148b010276fc9c5eb1cfbf2e6e8289c/core/src/main/java/org/apache/iceberg/expressions/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)` type s 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 -- 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]
