Anthrino commented on code in PR #3460:
URL: https://github.com/apache/calcite/pull/3460#discussion_r1353050970


##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -405,19 +406,20 @@ private Pattern validateRegexPattern(String regex, String 
methodName) {
       }
     }
 
-    /** Helper for multiple capturing group regex check in REGEXP_* fns. */
+    /** Helper to check for multiple capturing groups in REGEXP_* fns, throws 
an exception
+     * if regex pattern has more than 1 capturing group, else nothing is 
returned. */
     private static void checkMultipleCapturingGroupsInRegex(Matcher matcher,
         String methodName) {
       if (matcher.groupCount() > 1) {
-        throw RESOURCE.multipleCapturingGroupsForRegexpExtract(
+        throw RESOURCE.multipleCapturingGroupsForRegexpFunctions(
             Integer.toString(matcher.groupCount()), methodName).ex();
       }
     }
 
     /** Helper for checking values of position and occurrence arguments in 
REGEXP_* fns.
-     * Regex fns not using occurrencePosition param pass a default value of 0.
-     * Throws an exception or returns true in case of failed value checks. */
-    private static boolean checkPosOccurrenceParamValues(int position,
+     * Functions not using occurrencePosition param pass a default value of 0. 
Throws an exception
+     * or returns false if any values are beyond accepted range, else returns 
true. */
+    private static boolean validatePosOccurrenceParamValues(int position,

Review Comment:
   Making helper method name and docs more descriptive based on Julian's 
feedback (ref: 
[CALCITE-5978](https://issues.apache.org/jira/browse/CALCITE-5978))



-- 
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]

Reply via email to