1111nit opened a new issue, #13450:
URL: https://github.com/apache/gluten/issues/13450

   ### Description
   
   **Description**:
   
   **Motivation**
   
   TRIM/LTRIM/RTRIM/LPAD/RPAD are core Flink SQL string functions. gluten-flink
   maps none of them, so any query projecting them fails function offload with
   `Function not supported: TRIM` — unusable on the velox backend.
   
   **Proposal**
   
   Offload them to the velox flinksql function set:
   
   velox side (companion PR): Flink-semantics implementations under
   `velox/functions/flinksql/` — the default trim removes only `0x20`
   (`TRIM(' \tabc ')` keeps the tab; prestosql strips all whitespace);
   `trim(str, seek)` treats seek as a UTF-8 character set in Flink's
   `(str, seek)` order (prestosql: ASCII-only; sparksql: reversed);
   `lpad/rpad(str, len, pad)` follow `SqlFunctionUtils` — `LPAD('abc', -1, 'x')`
   returns NULL where prestosql/sparksql raise a user error. Same-name
   registration overwrites the sparksql baseline (the `regexp_extract`
   precedent).
   
   planner side (this repo): plain name mappings for LTRIM/RTRIM/LPAD/RPAD; a
   dedicated TRIM converter dispatches on the flag literal (Calcite normalizes
   `TRIM(s)` to `(BOTH, ' ', s)`) and reorders the operands to `(str, seek)`.
   
   Semantics to preserve: 0x20-only default trim; seek is a character set, not
   a prefix; NULL propagation; LPAD/RPAD truncate to `len` characters and
   return NULL for a negative `len` or an empty pad.
   
   ### Gluten version
   
   main branch


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