snuyanzin commented on code in PR #27577:
URL: https://github.com/apache/flink/pull/27577#discussion_r4473683553
##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java:
##########
@@ -515,6 +515,30 @@ public static Matcher getRegexpMatcher(@Nullable
StringData str, @Nullable Strin
}
}
+ /**
+ * Returns a compiled Pattern object for the given regular expression
string, using a shared
+ * cache for performance optimization.
+ *
+ * @param regex the regular expression pattern string
+ * @return the compiled Pattern, or null if regex is invalid
+ */
+ public static @Nullable Pattern getRegexpPattern(String regex) {
+ try {
+ return REGEXP_PATTERN_CACHE.get(regex);
+ } catch (PatternSyntaxException e) {
+ return null;
+ }
+ }
+
+ /** Splits the string into Unicode code points, preserving supplementary
characters. */
+ public static StringData[] splitByCodePoints(String str) {
Review Comment:
why do we need it public?
it is used only in one place, correct?
can we move it there?
--
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]