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:42:00 UTC

[jira] [Updated] (SPARK-27952) Built-in function: lag

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

Yuming Wang updated SPARK-27952:
--------------------------------
    Description: 
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


  was:
[https://www.postgresql.org/docs/8.4/functions-window.html]
|{{lag({{value}} {{any}} [, {{offset}}{{integer}} [, {{default}} {{any}} ]])}}|{{same type as }}{{value}}|returns {{value}} evaluated at the row that is {{offset}} rows before the current row within the partition; if there is no such row, instead return {{default}}. Both {{offset}}and {{default}} are evaluated with respect to the current row. If omitted, {{offset}} defaults to 1 and {{default}} to null|


> Built-in function: lag
> ----------------------
>
>                 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