Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-21225

OverConvertRule does not consider distinct

    XMLWordPrintableJSON

    Details

      Description

      We don't support OVER window distinct aggregates in Table API. Even though this is explicitly documented:

      https://ci.apache.org/projects/flink/flink-docs-release-1.12/dev/table/tableApi.html#aggregations

      // Distinct aggregation on over window
      Table result = orders
          .window(Over
              .partitionBy($("a"))
              .orderBy($("rowtime"))
              .preceding(UNBOUNDED_RANGE)
              .as("w"))
          .select(
              $("a"), $("b").avg().distinct().over($("w")),
              $("b").max().over($("w")),
              $("b").min().over($("w"))
          );
      

      The distinct flag is set to false in OverConvertRule.

      See also
      http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/Unknown-call-expression-avg-amount-when-use-distinct-in-Flink-Thanks-td40905.html

        Attachments

          Activity

            People

            • Assignee:
              qingyue Jane Chan
              Reporter:
              twalthr Timo Walther
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: