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

Jerin John commented on CALCITE-5979:
-------------------------------------

[~julianhyde] [~tanclary], did some further testing with RE2 and it seems like 
the the invalid regex cases we identified in CALCITE-5910 are being processed 
identical to Java regex, i.e. BQ was able to identify those as incorrect regex 
but it might not be getting caught directly by the RE2 library as per our 
original assumption, there could be custom error checks they implemented on top 
of it.

There might be a possibility that they're using a different/internal version of 
RE2 (possibly the C wrapper) while I tested with the [re2j Java 
wrapper|https://github.com/google/re2j] which may not have included this 
functionality, not sure how we can ascertain that but based on this observation 
RE2 backend might not be the reason for these additional supported features.

> Add REGEXP_REPLACE function (enabled in BigQuery library)
> ---------------------------------------------------------
>
>                 Key: CALCITE-5979
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5979
>             Project: Calcite
>          Issue Type: Task
>            Reporter: Jerin John
>            Assignee: Jerin John
>            Priority: Major
>              Labels: pull-request-available
>
> Add support for [REGEXP_REPLACE 
> |https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_replace]
>  function from BigQuery.
> *{{REGEXP_REPLACE(value, regexp, replacement)}}*
> Returns a STRING where all substrings of {{value}} that match regular 
> expression {{regexp}} are replaced with {{{}replacement{}}}.
> backslashed-escaped digits (\1 to \9) can be used within the {{replacement}} 
> argument to insert text matching the corresponding parenthesized group in the 
> {{regexp}} pattern.
> Example (added one space between \ \ to override md formatting):
> {{SELECT REGEXP_REPLACE("abc'", "b(.)", "X\ \1") as result;}}
> |result|
> |aXc|



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

Reply via email to