Phixsura opened a new pull request, #38704:
URL: https://github.com/apache/shardingsphere/pull/38704

   ## Background
   SQL Federation rejects three common MySQL string functions because they are 
not registered in `MySQLOperatorTable`, producing `No match found for function 
signature LENGTH/BIT_LENGTH/LOCATE(...)`. Reported in #31897, #31898, #31899.
   
   ## Changes
   - Add `MySQLLengthFunction`, `MySQLBitLengthFunction`, `MySQLLocateFunction` 
as `SqlUserDefinedFunction` subclasses with operand metadata matching MySQL 
semantics (UTF-8 byte count for character values, raw length for `byte[]`, 
1-based positions with the optional start position respected and clamped).
   - Register `LENGTH`, `BIT_LENGTH`, `LOCATE`, and `LOCATE_WITH_POSITION` in 
`MySQLOperatorTable`.
   - Calcite's `SqlLibraryOperators.LENGTH` lives in HIVE / POSTGRESQL / 
BIG_QUERY libraries and uses character-count semantics, so a MySQL-specific 
implementation is required.
   
   ## Verification
   - 30 new unit tests across the three functions covering null, empty, 
multi-byte UTF-8, `byte[]`, and LOCATE position boundaries.
   - 4 new cases in `federation-query-sql-cases.xml` pinning the generated 
Calcite plan; `SQLStatementCompilerIT` 111 / 111 (107 baseline + 4 new).
   - `spotless:check`, `checkstyle:check`, `apache-rat:check` all green on 
`kernel/sql-federation/compiler`.
   
   Closes #31897
   Closes #31898
   Closes #31899


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