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

Allow user-defined SqlGroupedWindowFunction

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.15.0
    • Component/s: core
    • Labels:
      None

      Description

      In Flink we want to create additional group auxiliary functions (such as TUMBLE_ROWTIME(), TUMBLE_PROCTIME()).

      Unfortunately, SqlGroupFunction and its methods are package-private which prevents us from adding custom functions. Also AuxiliaryConverter limits because it is statically defined and not pluggable.

        Issue Links

          Activity

          Hide
          julianhyde Julian Hyde added a comment -

          Resolved in release 1.15.0 (2017-12-11).

          Show
          julianhyde Julian Hyde added a comment - Resolved in release 1.15.0 (2017-12-11).
          Hide
          julianhyde Julian Hyde added a comment - - edited

          Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/f596f92a; thanks for the PR, Timo Walther!

          I renamed SqlGroupFunction to SqlGroupedWindowFunction and moved it to the org.apache.calcite.sql package.

          Show
          julianhyde Julian Hyde added a comment - - edited Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/f596f92a ; thanks for the PR, Timo Walther ! I renamed SqlGroupFunction to SqlGroupedWindowFunction and moved it to the org.apache.calcite.sql package.
          Hide
          julianhyde Julian Hyde added a comment -

          As a new API, there really ought to be tests (using a mock implementation of SqlGroupWindowFunction) to make sure that the interface encapsulates everything. Otherwise we both know that this feature will be extremely brittle. If we don't add those tests, we should tag this @Experimental.

          Show
          julianhyde Julian Hyde added a comment - As a new API, there really ought to be tests (using a mock implementation of SqlGroupWindowFunction) to make sure that the interface encapsulates everything. Otherwise we both know that this feature will be extremely brittle. If we don't add those tests, we should tag this @Experimental .
          Hide
          julianhyde Julian Hyde added a comment -

          At https://github.com/apache/calcite/pull/549 Timo Walther wrote:

          This PR allows to creating additional grouped window functions. I chose SqlGroupedWindowFunction as a new name that also complies with the Java docs. This PR does not fully implement CALCITE-1867 (custom AuxiliaryConverter functionality is still missing), but solves most of the problems we have at Apache Flink.

          I'm reviewing and testing https://github.com/apache/calcite/pull/549/commits/a18cbaa23f6c04570eb888ffdf345c6375604640 now.

          Show
          julianhyde Julian Hyde added a comment - At https://github.com/apache/calcite/pull/549 Timo Walther wrote: This PR allows to creating additional grouped window functions. I chose SqlGroupedWindowFunction as a new name that also complies with the Java docs. This PR does not fully implement CALCITE-1867 (custom AuxiliaryConverter functionality is still missing), but solves most of the problems we have at Apache Flink. I'm reviewing and testing https://github.com/apache/calcite/pull/549/commits/a18cbaa23f6c04570eb888ffdf345c6375604640 now.
          Hide
          julianhyde Julian Hyde added a comment -

          Makes sense.

          Before we make the APIs public (therefore permanent) I wish we could find a better name than "group function" (or "window function") because those names are taken.

          Show
          julianhyde Julian Hyde added a comment - Makes sense. Before we make the APIs public (therefore permanent) I wish we could find a better name than "group function" (or "window function") because those names are taken.

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              twalthr Timo Walther
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development