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 E8D19200C3C for ; Sat, 4 Mar 2017 23:29:53 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E7ABB160B85; Sat, 4 Mar 2017 22:29:53 +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 3B1E7160B82 for ; Sat, 4 Mar 2017 23:29:53 +0100 (CET) Received: (qmail 78757 invoked by uid 500); 4 Mar 2017 22:29:52 -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 78748 invoked by uid 99); 4 Mar 2017 22:29:52 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Mar 2017 22:29:52 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 068ECC0C05 for ; Sat, 4 Mar 2017 22:29:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.652 X-Spam-Level: X-Spam-Status: No, score=0.652 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_NEUTRAL=0.652, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id RHFkH2Os6h2G for ; Sat, 4 Mar 2017 22:29:51 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 4362960DBE for ; Sat, 4 Mar 2017 22:29: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 09B37E02FD for ; Sat, 4 Mar 2017 22:29:49 +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 F015224178 for ; Sat, 4 Mar 2017 22:29:46 +0000 (UTC) Date: Sat, 4 Mar 2017 22:29:46 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-5956) Add retract method into the aggregateFunction MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 04 Mar 2017 22:29:54 -0000 [ https://issues.apache.org/jira/browse/FLINK-5956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15895907#comment-15895907 ] ASF GitHub Bot commented on FLINK-5956: --------------------------------------- Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/3470#discussion_r104298360 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/functions/aggfunctions/SumAggFunction.scala --- @@ -67,9 +80,9 @@ abstract class SumAggFunction[T: Numeric] extends AggregateFunction[T] { var i: Int = 0 while (i < accumulators.size()) { val a = accumulators.get(i).asInstanceOf[SumAccumulator[T]] - if (a.f1) { + if (a.f1 > 0) { --- End diff -- Do we need this check? If `a.f1` is `0`, `a.f0` should be `0` as well (if we only retract what was added before) and we can simply add sum and count. > Add retract method into the aggregateFunction > --------------------------------------------- > > Key: FLINK-5956 > URL: https://issues.apache.org/jira/browse/FLINK-5956 > Project: Flink > Issue Type: Sub-task > Components: Table API & SQL > Reporter: Shaoxuan Wang > Assignee: Shaoxuan Wang > > Retraction method is help for processing updated message. It will also very helpful for window Aggregation. This PR will first add retraction methods into the aggregateFunctions, such that on-going over window Aggregation can get benefit from it. -- This message was sent by Atlassian JIRA (v6.3.15#6346)