Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
-
Docs Required, Release Notes Required
Description
Currently, all SQL string length-dependent functions (length, substr, right, left, lpad, rpad, etc) work correctly only with up to 16-bit Unicode characters. These functions mapped to java String class functions (length, substring, etc), which operates with an array of 16-bit char's. For example, the result of {{"🦆".length()}} will be 2, and the result of SELECT CHAR_LENGTH('🦆') will be 2.
Java String class has method offsetByCodePoints which can be used to implement functions that correctly work with 32-bit characters, but there will be a performance drop if this method will be used for all strings. Perhaps we need dedicated functions with 32-bit characters support.
Attachments
Issue Links
- is duplicated by
-
IGNITE-15110 Calcite bug. Function CHAR_LENGTH works incorrect with UNICODE
- Resolved
- is part of
-
IGNITE-14535 Caclite SQL engine capabilities
- Open
- relates to
-
IGNITE-14545 Calcite engine. Unicode literal not supported
- Resolved