You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Yuming Wang (JIRA)" <ji...@apache.org> on 2019/06/20 08:43:00 UTC

[jira] [Updated] (SPARK-27952) String Functions: regexp_replace is not compatible

     [ https://issues.apache.org/jira/browse/SPARK-27952?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yuming Wang updated SPARK-27952:
--------------------------------
    Summary: String Functions: regexp_replace is not compatible  (was: Built-in function: lag)

> String Functions: regexp_replace is not compatible
> --------------------------------------------------
>
>                 Key: SPARK-27952
>                 URL: https://issues.apache.org/jira/browse/SPARK-27952
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: Zhu, Lipeng
>            Priority: Major
>
> PostgreSQL's {{regexp_replace}} has the syntax: {{regexp_replace(source, pattern, replacement [, flags ])}}. This is not compatible with our syntax {{regexp_replace(str, regexp, rep)}}. The _*flags*_ parameter is an optional text string containing zero or more single-letter flags that change the function's behavior. Flag {{i}} specifies case-insensitive matching, while flag g specifies replacement of each matching substring rather than only the first one. Some examples:
> {noformat}
> regexp_replace('foobarbaz', 'b..', 'X')
>                                    fooXbaz
> regexp_replace('foobarbaz', 'b..', 'X', 'g')
>                                    fooXX
> regexp_replace('foobarbaz', 'b(..)', 'X\1Y', 'g')
>                                    fooXarYXazY
> {noformat}
> More details: https://www.postgresql.org/docs/11/functions-matching.html#FUNCTIONS-POSIX-REGEXP



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org