You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jesus Camacho Rodriguez (JIRA)" <ji...@apache.org> on 2017/06/19 17:30:00 UTC

[jira] [Resolved] (CALCITE-1647) Classifier and match_number syntax support for MATCH_RECOGNIZE

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

Jesus Camacho Rodriguez resolved CALCITE-1647.
----------------------------------------------
       Resolution: Fixed
    Fix Version/s: 1.13.0

Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/304eb9c .

Thanks [~ransom]!

> Classifier and match_number syntax support for MATCH_RECOGNIZE
> --------------------------------------------------------------
>
>                 Key: CALCITE-1647
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1647
>             Project: Calcite
>          Issue Type: Sub-task
>          Components: core
>    Affects Versions: 1.11.0
>            Reporter: Zhiqiang He
>            Assignee: Zhiqiang He
>              Labels: features
>             Fix For: 1.13.0
>
>
> h1. MATCH_NUMBER: Finding Which Rows Are in Which Match
> Matches within a row pattern partition are numbered sequentially starting with 1 in the order they are found. Note that match numbering starts over again at 1 in each row pattern partition, because there is no inherent ordering between row pattern partitions. MATCH_NUMBER() is a function that returns a numeric value with scale 0 (zero) whose value is the sequential number of the match within the row pattern partition.
> The previous examples using MATCH_NUMBER() have shown it used in the MEASURES clause. It is also possible to use MATCH_NUMBER() in the DEFINE clause, where it can be used to define conditions that depend upon the match number.
> h1. CLASSIFIER: Finding Which Pattern Variable Applies to Which Rows
> The CLASSIFIER function returns a character string whose value is the name of the pattern variable to which a row is mapped. The CLASSIFIER function is allowed in both the MEASURES and the DEFINE clauses.
> In the DEFINE clause, the CLASSIFIER function returns the name of the primary pattern variable to which the current row is mapped.
> In the MEASURES clause:
> * If ONE ROW PER MATCH is specified, the query is using the last row of the match when processing the MEASURES clause, so the CLASSIFIER function returns the name of the pattern variable to which the last row of the match is mapped.
> * If ALL ROWS PER MATCH is specified, for each row of the match found, the CLASSIFIER function returns the name of the pattern variable to which the row is mapped.
> The classifier for the starting row of an empty match is the null value.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)