apache / inlong

Apache InLong - a one-stop, full-scenario integration framework for massive data
https://inlong.apache.org/
Apache License 2.0
1.37k stars 534 forks source link

[Feature][SDK] Transform SQL supports CHAR_LENGTH function #11237

Open Zkplo opened 3 days ago

Zkplo commented 3 days ago

Description

CHAR_LENGTH(str): Returns the length of the string str, measured in code points. A multibyte character counts as a single code point. This means that, for a string containing two 3-byte characters, LENGTH() returns 6, whereas CHAR_LENGTH() returns 2

Use case

mysql> SET @dolphin:='海豚';

mysql> SELECT LENGTH(@dolphin), CHAR_LENGTH(@dolphin);
+------------------+-----------------------+
| LENGTH(@dolphin) | CHAR_LENGTH(@dolphin) |
+------------------+-----------------------+
|                6 |                     2 |
+------------------+-----------------------+
1 row in set (0.00 sec)

Are you willing to submit PR?

Code of Conduct