Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 25145200C13 for ; Mon, 6 Feb 2017 18:19:55 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 2378F160B56; Mon, 6 Feb 2017 17:19:55 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6E867160B53 for ; Mon, 6 Feb 2017 18:19:54 +0100 (CET) Received: (qmail 61582 invoked by uid 500); 6 Feb 2017 17:19:53 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 61573 invoked by uid 99); 6 Feb 2017 17:19:53 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2017 17:19:53 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 21BAEC0C68 for ; Mon, 6 Feb 2017 17:19:53 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id RV-TLls9cbl7 for ; Mon, 6 Feb 2017 17:19:52 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 950555F1E9 for ; Mon, 6 Feb 2017 17:19:51 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 29008E027E for ; Mon, 6 Feb 2017 17:19:42 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id DCCE12528C for ; Mon, 6 Feb 2017 17:19:41 +0000 (UTC) Date: Mon, 6 Feb 2017 17:19:41 +0000 (UTC) From: "Fabian Hueske (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-5564) User Defined Aggregates MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 06 Feb 2017 17:19:55 -0000 [ https://issues.apache.org/jira/browse/FLINK-5564?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1585= 4402#comment-15854402 ]=20 Fabian Hueske commented on FLINK-5564: -------------------------------------- Hi [~Shaoxuan Wang], I think it should be possible to split the first three= steps as follows: 1. Add the new UDAGG interface and migrate existing aggregation functions t= o it. We keep the current implementation and just add code and unit tests for the= implementations of the aggregation functions that implement the new interf= ace. 2. Use the new aggregation function for batch tables. We switch the implementation for the DataSet runtime code. We still keep th= e old aggregation functions for the streaming code. 3. Use the new aggregation function for streaming tables. We switch the implementation for the DataStream runtime code. In this step = we remove the old aggregation functions and clean up. Adressing 1, 2, and 3 in a single issue will result in a huge PR which will= be hard to review. I'd prefer several smaller steps with well defined scop= e. Regarding the discussion of the window OVER functions. It would be great if= you could post your comment (with which I agree) to the corresponding JIRA= issue and the discussion on the dev list otherwise it might not be noticed= . Thanks, Fabian > User Defined Aggregates > ----------------------- > > Key: FLINK-5564 > URL: https://issues.apache.org/jira/browse/FLINK-5564 > Project: Flink > Issue Type: Improvement > Components: Table API & SQL > Reporter: Shaoxuan Wang > Assignee: Shaoxuan Wang > > User-defined aggregates would be a great addition to the Table API / SQL. > The current aggregate interface is not well suited for the external users= . This issue proposes to redesign the aggregate such that we can expose an= better external UDAGG interface to the users. The detailed design proposal= can be found here: https://docs.google.com/document/d/19JXK8jLIi8IqV9yf7hO= s_Oz67yXOypY7Uh5gIOK2r-U/edit > Motivation: > 1. The current aggregate interface is not very concise to the users. One = needs to know the design details of the intermediate Row buffer before impl= ements an Aggregate. Seven functions are needed even for a simple Count agg= regate. > 2. Another limitation of current aggregate function is that it can only b= e applied on one single column. There are many scenarios which require the = aggregate function taking multiple columns as the inputs. > 3. =E2=80=9CRetraction=E2=80=9D is not considered and covered in the curr= ent Aggregate. > 4. It might be very good to have a local/global aggregate query plan opti= mization, which is very promising to optimize UDAGG performance in some sce= narios. > Proposed Changes: > 1. Implement an aggregate dataStream API (Done by [FLINK-5582|https://iss= ues.apache.org/jira/browse/FLINK-5582]) > 2. Update all the existing aggregates to use the new aggregate dataStream= API > 3. Provide a better User-Defined Aggregate interface > 4. Add retraction support > 5. Add local/global aggregate -- This message was sent by Atlassian JIRA (v6.3.15#6346)