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

Jerin John edited comment on CALCITE-5858 at 8/10/23 12:14 AM:
---------------------------------------------------------------

Hi [~hongyuguo], thank you for your comment! 
Yes I did see the REGEXP_REPLACE implementation and went with the Java native 
regex library for the new BQ functions, but like you rightly guessed there are 
some inconsistencies with the processing between the two libraries.

Please refer to the discussion on CALCITE-5910 to decide on the usage of re2j 
library in Java instead of util.regex to have identical processing.


was (Author: JIRAUSER301314):
Hi [~hongyuguo], thank you for your comment! 
Yes I did see the REGEXP_REPLACE implementation and went with the Java native 
regex library for the new BQ functions, but like you rightly guessed there are 
some inconsistencies with the processing between the two libraries.

Please refer to the discussion on CALCITE-5910  about the usage of re2j library 
in Java instead of util.regex to have identical processing.

> 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