raminqaf commented on code in PR #28189:
URL: https://github.com/apache/flink/pull/28189#discussion_r3258955894
##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/functions/SqlFunctionUtils.java:
##########
@@ -422,21 +422,20 @@ public static String splitIndex(String str, int
character, int index) {
/**
* Returns a string resulting from replacing all substrings that match the
regular expression
- * with replacement.
+ * with replacement. Literal regexes are validated at planning time by the
input type strategy.
*/
public static String regexpReplace(String str, String regex, String
replacement) {
if (str == null || regex == null || replacement == null) {
return null;
}
try {
- return str.replaceAll(regex,
Matcher.quoteReplacement(replacement));
- } catch (Exception e) {
- LOG.error(
- String.format(
- "Exception in regexpReplace('%s', '%s', '%s')",
- str, regex, replacement),
- e);
- // return null if exception in regex replace
+ return REGEXP_PATTERN_CACHE
Review Comment:
That is a good point. I am planing to change it. But Since I have applied
this to REGEX_EXTRACT function too I would keep it in this PR.
--
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]