Avinash Upadhyaya
08/21/2024, 10:52 AM[a-zA-Z0-9~\-_.]+
as my regular expression and my SQL query has the same. It throws the following error
Invalid regular expression '[A-Za-z0-9~\-_.]+'
at org.apache.flink.table.functions.SqlLikeUtils.invalidRegularExpression(SqlLikeUtils.java:178)
at org.apache.flink.table.functions.SqlLikeUtils.sqlSimilarRewriteCharEnumeration(SqlLikeUtils.java:221)
at org.apache.flink.table.functions.SqlLikeUtils.sqlToRegexSimilar(SqlLikeUtils.java:285)
at org.apache.flink.table.functions.SqlLikeUtils.sqlToRegexSimilar(SqlLikeUtils.java:240)
at org.apache.flink.table.functions.SqlLikeUtils.similar(SqlLikeUtils.java:80)
However, [A-Za-z0-9~\-.]+
works. The problem is with _
and it happens on https://github.com/apache/flink/blob/56c81995d3b34ed9066b6771755407b93438f5ab/flin[β¦]rc/main/java/org/apache/flink/table/functions/SqlLikeUtils.java If the regex contains one of the special characters defined in _SQL_SIMILAR_SPECIALS_, it throws an invalidRegularExpression exception.shikai ng
08/22/2024, 5:59 PMstring1 SIMILAR TO string2 [ ESCAPE char ]
just suggesting according to the docs, never really tried before π