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

OverConvertRule does not consider distinct

Agile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment