jduo commented on code in PR #3730:
URL: https://github.com/apache/calcite/pull/3730#discussion_r1525221820


##########
site/_docs/reference.md:
##########
@@ -2820,7 +2820,7 @@ In the following:
 | b | REGEXP_EXTRACT(string, regexp [, position [, occurrence]]) | Returns the 
substring in *string* that matches the *regexp*, starting search at *position* 
(default 1), and until locating the nth *occurrence* (default 1). Returns NULL 
if there is no match
 | b | REGEXP_EXTRACT_ALL(string, regexp)             | Returns an array of all 
substrings in *string* that matches the *regexp*. Returns an empty array if 
there is no match
 | b | REGEXP_INSTR(string, regexp [, position [, occurrence [, 
occurrence_position]]]) | Returns the lowest 1-based position of the substring 
in *string* that matches the *regexp*, starting search at *position* (default 
1), and until locating the nth *occurrence* (default 1). Setting 
occurrence_position (default 0) to 1 returns the end position of substring + 1. 
Returns 0 if there is no match
-| s | REGEXP_LIKE(string, regexp)                    | Equivalent to `string1 
RLIKE string2`
+| m o p s | REGEXP_LIKE(string, regexp [, flags])        | Equivalent to 
`string1 RLIKE string2` with an optional parameter for search flags. Supported 
flags are: <ul><li>i: case-insensitive matching</li><li>c: case-sensitive 
matching</li><li>n: newline-sensitive matching</li><li>s: non-newline-sensitive 
matching</li><li>m: multi-line</li></ul>

Review Comment:
   The comment for Oracle 
(https://docs.oracle.com/cd/B13789_01/server.101/b10759/conditions018.htm) says 
`REGEXP_LIKE` is similar to `LIKE`, except it uses regular expression matching.
   
   The description for PostgresSQL in Table 9.25 of 
https://www.postgresql.org/docs/current/functions-matching.html says it is 
equivalent to `LIKE_REGEX`, rather than `LIKE`



##########
core/src/main/java/org/apache/calcite/sql/fun/SqlLibraryOperators.java:
##########
@@ -557,10 +557,10 @@ static RelDataType deriveTypeSplit(SqlOperatorBinding 
operatorBinding,
           SqlFunctionCategory.STRING);
 
   /** The "REGEXP_LIKE(value, regexp)" function, equivalent to {@link #RLIKE}. 
*/
-  @LibraryOperator(libraries = {SPARK})
+  @LibraryOperator(libraries = {SPARK, MYSQL, POSTGRESQL, ORACLE})

Review Comment:
   We decided to make them consistent, and allow Spark to accept the 3-arg 
version as well. See the discussion here:
   https://issues.apache.org/jira/browse/CALCITE-6309



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