[ 
https://issues.apache.org/jira/browse/CALCITE-5858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17752438#comment-17752438
 ] 

hongyu guo edited comment on CALCITE-5858 at 8/9/23 3:09 PM:
-------------------------------------------------------------

Calcite has already implement a function named 'REGEXP_REPLACE'(CALCITE-3680), 
which use java.util.regex.{Matcher, Pattern} to match regular expression. 
But BigQuery say

{quote}Note: GoogleSQL provides regular expression support using the 
[re2|https://github.com/google/re2/wiki/Syntax] library.
{quote}
I think all the regex function in calcite should use the same library. (If I 
have any misconceptions, please correct me.)
re2 is a C++ implemented regular expression, I don't know if the two library 
has the same output for the same input. 



was (Author: JIRAUSER300840):
Calcite has already implement a function named 'REGEXP_REPLACE'(CALCITE-3680), 
which use java.util.regex.{Matcher, Pattern} to match regular expression. 
But BigQuery say

{panel:title=BigQuery}
Note: GoogleSQL provides regular expression support using the 
[re2|https://github.com/google/re2/wiki/Syntax] library.
{panel}

I think all the regex function in calcite should use the same library. (If I 
have any misconceptions, please correct me.)
re2 is a C++ implemented regular expression, I don't know if the two library 
has the same output for the same input. 


> Add REGEXP_CONTAINS, REGEXP_EXTRACT, REGEXP_EXTRACT_ALL, REGEXP_INSTR, 
> REGEXP_REPLACE and REGEXP_SUBSTR functions (enabled in BigQuery library)
> -----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-5858
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5858
>             Project: Calcite
>          Issue Type: New Feature
>            Reporter: Jerin John
>            Assignee: Jerin John
>            Priority: Major
>
> Add support for REGEX_* string functions in BigQuery.
> Function descriptions:
>  * REGEXP_CONTAINS: Returns TRUE if input value is a partial match for the 
> regular expression.
>  * REGEXP_EXTRACT: Returns the substring in input value that matches the 
> regular expression. Returns NULL if there is no match.
>  * REGEXP_EXTRACT_ALL: Returns an array of all substrings of input value that 
> match the regular expression. Returns an empty array if there is no match.
>  * REGEXP_INSTR: Returns the lowest 1-based position of a regular expression 
> in an input value.
>  * REGEXP_REPLACE: Returns a STRING where all substrings of input value that 
> match regular expression are replaced with the input replacement.
>  * REGEXP_SUBSTR: Synonym for REGEXP_EXTRACT, returns the substring in input 
> value that matches the regular expression. Returns NULL if there is no match.
> More on these functions and their syntax may be found here: [BigQuery 
> Doc|https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_contains]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to