Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1909

Output rowType of Match should include PARTITION BY and ORDER BY columns

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.14.0
    • Component/s: None
    • Labels:

      Description

      According to the documentation, the output rowType should also include partition by key columns and order by key columns.

      MATCH_RECOGNIZE is called the row pattern output table. The shape (row type) of the row pattern output table depends on the choice of ONE ROW PER MATCH or ALL ROWS PER MATCH:

      • If ONE ROW PER MATCH is specied or implied, then the columns of the row pattern output table are the row pattern partitioning columns in their order of declaration, followed by the row pattern measure columns in their order of declaration. Since a table must have at least one column, this implies that there must be at least one row pattern partitioning column or one row pattern measure column.
      • If ALL ROWS PER MATCH is speci ed, then the columns of the row pattern output table are the row pattern partitioning columns in their order of declaration, the ordering columns in their order of declaration, the row pattern measure columns in their order of declaration, and nally any remaining columns of the row pattern input table, in the order they occur in the row pattern input table.

      Currently, partition key columns and order by key columns are not included in the output row type.

        Activity

        Hide
        michaelmior Michael Mior added a comment -

        Resolved in release 1.14.0 (2017-10-01)

        Show
        michaelmior Michael Mior added a comment - Resolved in release 1.14.0 (2017-10-01)
        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/9efefbc8 .
        Hide
        julianhyde Julian Hyde added a comment -

        Reviewing and testing now.

        Show
        julianhyde Julian Hyde added a comment - Reviewing and testing now.
        Hide
        ransom Zhiqiang He added a comment - - edited
        Show
        ransom Zhiqiang He added a comment - - edited Julian Hyde please review it , thanks. https://github.com/apache/calcite/pull/508
        Hide
        ransom Zhiqiang He added a comment -

        It is a bug. I will fix it later.

        Show
        ransom Zhiqiang He added a comment - It is a bug. I will fix it later.
        Hide
        julianhyde Julian Hyde added a comment - - edited

        Zhiqiang He, What do you think?

        Show
        julianhyde Julian Hyde added a comment - - edited Zhiqiang He , What do you think?

          People

          • Assignee:
            ransom Zhiqiang He
            Reporter:
            dian.fu Dian Fu
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development