jackylee-ch opened a new pull request, #10179:
URL: https://github.com/apache/paimon/pull/10179

   ## Purpose
   
   A REST catalog can hand PyPaimon a query-auth column-masking / row-filter
   rule whose transform is any of the Java predicate transforms. The Python
   `predicate_json_parser` handled `CAST` / `UPPER` / `LOWER` / `CONCAT` /
   `CONCAT_WS` / `SUBSTRING` / `TRIM` / `NULL` but raised `Unknown transform
   type` for the string transforms `LENGTH`, `BIT_LENGTH`, `OVERLAY`, `PAD` and
   `TRANSLATE` — so a table whose auth rule used one of them failed to read at
   all.
   
   ## Change
   
   - Add the five transforms to `_apply_predicate_transform`, mirroring Java:
     `LENGTH` = char count, `BIT_LENGTH` = UTF-8 byte count × 8 (both INT);
     `TRANSLATE` = code-point map (first mapping wins, a 0/absent replacement
     deletes); `OVERLAY` reuses the existing SQL-substring helper (replaced
     length defaults to the replacement length when omitted or negative);
     `PAD` (LPAD/RPAD) truncates when the target is shorter than the source.
   - Null arguments propagate to a null result, as in SQL / the Java transforms.
   
   ## Tests
   
   - Per-transform output against the Java semantics (map/delete, overlay with
     and without length, left/right pad and truncation, null propagation) plus
     one wired through a `LEAF` filter. Verified non-vacuous (removing the
     branches makes the six feature cases raise `Unknown transform type`).
   
   Written with Claude Code; verification is mine.
   


-- 
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]

Reply via email to