Skip to content

[spec] Support parsing REST catalog Predicate and Transform JSON#500

Open
plusplusjiajia wants to merge 1 commit into
apache:mainfrom
plusplusjiajia:predicate-java-json
Open

[spec] Support parsing REST catalog Predicate and Transform JSON#500
plusplusjiajia wants to merge 1 commit into
apache:mainfrom
plusplusjiajia:predicate-java-json

Conversation

@plusplusjiajia

@plusplusjiajia plusplusjiajia commented Jul 11, 2026

Copy link
Copy Markdown
Member

Purpose

Deserialize the REST catalog's serialized Predicate and Transform JSON
(the row filter / column masking a query-auth.enabled table returns) into
spec::Predicate / spec::Transform. Parse-only — needed by the query-auth
enforcement follow-up.

Changes

  • Predicate::from_rest_json + collect_leaf_field_indices
  • spec::Transform / TransformInput + Transform::from_rest_json +
    collect_field_indices
  • Field references resolve by name; the local field type drives literal
    conversion. Tests pin wire strings from Java's PredicateJsonSerdeTest /
    TransformJsonSerdeTest.

Scope

Structural parsing only, following the crate's existing pattern for
REST-serialized payloads (Schema uses #[derive(Deserialize)]; the shared
DataType parser already accepts lenient type strings for schema columns).
It does not replicate the Java parser bit-for-bit:

  • CAST is parsed structurally; cast applicability is checked where the mask
    is applied (arrow cast + output-type equality), not here.
  • LIKE uses SQL escape semantics; row-filter evaluation reuses the shared
    residual evaluator (arrow/residual.rs), so Float/Double.compareTo and
    LIKE _ edge semantics are Arrow's — a documented limitation

@plusplusjiajia plusplusjiajia changed the title [spec] Support parsing Java-serialized Predicate and Transform JSON 【WIP】[spec] Support parsing Java-serialized Predicate and Transform JSON Jul 11, 2026
@plusplusjiajia plusplusjiajia force-pushed the predicate-java-json branch 4 times, most recently from 9ac110f to 5b21096 Compare July 11, 2026 06:15
@plusplusjiajia plusplusjiajia changed the title 【WIP】[spec] Support parsing Java-serialized Predicate and Transform JSON 【WIP】[spec] Support parsing REST catalog Predicate and Transform JSON Jul 11, 2026
@plusplusjiajia plusplusjiajia changed the title 【WIP】[spec] Support parsing REST catalog Predicate and Transform JSON [spec] Support parsing REST catalog Predicate and Transform JSON Jul 11, 2026
@JingsongLi

Copy link
Copy Markdown
Contributor

Incompatible with Java legitimate wire format: Java will generate 'LEAF+transform=NULL+function=TRUS/FALSE', which Rust currently explicitly rejects. The result is a failed valid query auth condition (fail closed, not unauthorized, but will erroneously reject the query).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants