Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.11.0
    • Fix Version/s: 1.13.0
    • Component/s: core
    • Labels:

      Description

      PARTITION BY: Logically Dividing the Rows into Groups

      Typically, you want to divide your input data into logical groups for analysis. In the examples with stocks, the pattern matching is divided so that it applies to just one stock at a time. To do this, use the PARTITION BY clause. PARTITION BY specifies that the rows of the input table are to be partitioned by one or more columns. Matches are found within partitions and do not cross partition boundaries.
      If there is no PARTITION BY, then all rows of the row pattern input table constitute a single row pattern partition.

      ORDER BY: Logically Ordering the Rows in a Partition

      The ORDER BY clause is used to specify the order of rows within a row pattern partition. If the order of two rows in a row pattern partition is not determined by ORDER BY, then the result of the MATCH_RECOGNIZE clause is non-deterministic: it may not give consistent results each time the query is run.

        Activity

        Hide
        ransom Zhiqiang He added a comment -
        Show
        ransom Zhiqiang He added a comment - https://github.com/apache/calcite/pull/468 please review it, thanks.
        Hide
        julianhyde Julian Hyde added a comment -

        Reviewing and testing now. I found a bug in SqlToRelConverter.convertMatchRecognize, assigning descending outside the loop, and fixed it. Otherwise looks fine.

        Show
        julianhyde Julian Hyde added a comment - Reviewing and testing now. I found a bug in SqlToRelConverter.convertMatchRecognize, assigning descending outside the loop, and fixed it. Otherwise looks fine.
        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/33873f64 .
        Hide
        jcamachorodriguez Jesus Camacho Rodriguez added a comment -

        Resolved in release 1.13.0 (2017-06-26).

        Show
        jcamachorodriguez Jesus Camacho Rodriguez added a comment - Resolved in release 1.13.0 (2017-06-26).

          People

          • Assignee:
            ransom Zhiqiang He
            Reporter:
            ransom Zhiqiang He
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development