snuyanzin commented on code in PR #29004:
URL: https://github.com/apache/flink/pull/29004#discussion_r3837748558
##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java:
##########
@@ -345,29 +331,39 @@ public static String rpad(String base, int len, String
pad) {
return "";
}
- char[] data = new char[len];
- char[] baseChars = base.toCharArray();
- char[] padChars = pad.toCharArray();
+ int baseEnd = endOfCodePoints(base, len);
+ int padChars = padLength(pad, len - base.codePointCount(0, baseEnd));
+ char[] data = new char[baseEnd + padChars];
Review Comment:
```suggestion
final int baseEnd = endOfCodePoints(base, len);
final int padChars = padLength(pad, len - base.codePointCount(0,
baseEnd));
final char[] data = new char[baseEnd + padChars];
```
--
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]