Anthrino commented on code in PR #3408:
URL: https://github.com/apache/calcite/pull/3408#discussion_r1317647557
##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -488,13 +502,74 @@ public List<String> regexpExtractAll(String value, String
regex) {
ImmutableList.Builder<String> matches = ImmutableList.builder();
while (matcher.find()) {
String match = matcher.group(matcher.groupCount());
- if (match != null && !match.isEmpty()) {
+ if (match != null) {
matches.add(match);
}
}
return matches.build();
}
+ /** SQL {@code REGEXP_INSTR(value, regexp)} function.
+ * Returns 0 if there is no match or regex is empty. Returns an exception
if regex is invalid.
+ * Uses position=1, occurrence=1, occurrencePosition=0 as default values
if not specified. */
+ public Integer regexpInstr(String value, String regex) {
Review Comment:
Yes I assumed that too, thanks will update it
--
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]