You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "tanclary (via GitHub)" <gi...@apache.org> on 2023/08/15 20:47:08 UTC
[GitHub] [calcite] tanclary commented on a diff in pull request #3338: [CALCITE-5873] Add REGEXP_CONTAINS function (enabled in BigQuery library)
tanclary commented on code in PR #3338:
URL: https://github.com/apache/calcite/pull/3338#discussion_r1295097215
##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -345,6 +346,17 @@ public static String sha512(ByteString string) {
return DigestUtils.sha512Hex(string.getBytes());
}
+ /** SQL {@code REGEXP_CONTAINS(value, regexp)} function.
+ * Throws a runtime exception for invalid regular expressions.*/
+ public static boolean regexpContains(String value, String regex) {
+ try {
+ Pattern regexp = Pattern.compile(regex);
Review Comment:
If you're going to stick with Java library, I think it would help to add a comment here or elsewhere linking to the case where that decision was made for future users/devs
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org