SEPURI-SAI-KRISHNA commented on code in PR #29123:
URL: https://github.com/apache/flink/pull/29123#discussion_r3998626184
##########
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/expressions/ScalarFunctionsTest.scala:
##########
@@ -106,6 +106,26 @@ class ScalarFunctionsTest extends ScalarTypesTestBase {
// invalid length
($"f0".overlay("IS", 6, -1), "OVERLAY(f0 PLACING 'IS' FROM 6 FOR -1)",
"This IS"),
+ // a zero length replaces nothing, so the whole tail survives
+ ("abcdef".overlay("X", 2, 0), "OVERLAY('abcdef' PLACING 'X' FROM 2 FOR
0)", "aXbcdef"),
+ ("abcdef".overlay("X", 1, 0), "OVERLAY('abcdef' PLACING 'X' FROM 1 FOR
0)", "Xabcdef"),
+ ("abcdef".overlay("X", 6, 0), "OVERLAY('abcdef' PLACING 'X' FROM 6 FOR
0)", "abcdeXf"),
+
+ // a supplementary-plane character is one character and is never split
into half a pair
Review Comment:
Added `SqlFunctionUtilsTest` covering both.
Unpaired surrogates are one character each, so `overlay("\ud83d\ud83d", "X",
1, 1)` gives `X\ud83d`. A string of only supplementary characters is
well-formed pairs, also one character each, already covered by the `'😀😀'` case
here.
--
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]