AnissaLiu opened a new pull request, #13460:
URL: https://github.com/apache/gluten/pull/13460

   
   ## What changes are proposed in this pull request?
   
   Fixes #13450
   
   Maps the Flink scalar functions TRIM/LTRIM/RTRIM/LPAD/RPAD to the velox
   flinksql implementations(companion velox PR 
https://github.com/bigo-sg/velox/pull/89):
   
   - `TRIM` → new `TrimRexCallConverter`: Calcite normalizes every TRIM call to
     three operands `(flag, seek, str)` (e.g. `TRIM(s)` becomes
     `(BOTH, ' ', s)`); the converter validates the flag literal, maps
     LEADING/TRAILING/BOTH to `ltrim`/`rtrim`/`trim`, and reorders the operands
     to `(str, seek)` to match the velox flinksql signatures. A non-literal
     flag is rejected in `isSuitable`.
   - `LTRIM`/`RTRIM` → `DefaultRexCallConverter("ltrim"/"rtrim")`: Flink's
     `(str[, seek])` operand order matches the velox signatures as-is.
   - `LPAD`/`RPAD` → `DefaultRexCallConverter("lpad"/"rpad")`: `(str, len, pad)`
     passes through unchanged; Flink INT matches the velox int32 signature.
   
   Note: the velox side (flinksql registrations of the same five functions) is
   prepared in a separate velox PR; the runtime path of the new e2e tests
   requires that native support, so the two PRs are sequenced accordingly.
   
   ## How was this patch tested?
   
   - New `TrimPadFunctionsTest` (9 cases) in `gluten-flink/ut`: end-to-end on
     the velox backend (bounded source, print sink) — one-arg trim family with
     tab preservation and all-space rows, the three TRIM flags with both
     literal and column seek, LPAD/RPAD boundaries (negative len → NULL,
     len 0, empty pad → NULL, truncation, multi-char pad cycling), NULL
     propagation and nested `LPAD(TRIM(c), 15, '*')`. All 9 pass.
   - `RexNodeConverterTest` regression: 2/2 pass.
   - Full dual-run verification (native Flink vs GlutenFlink, changangelog
     folding, 7 SQL cases / 14 FINISHED jobs, field-exact match) was performed
     on the combined stack; evidence retained in the GFV workspace.


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

Reply via email to