From issues-return-164052-archive-asf-public=cust-asf.ponee.io@flink.apache.org Wed Apr 25 18:30:37 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 5BC6D180679 for ; Wed, 25 Apr 2018 18:30:37 +0200 (CEST) Received: (qmail 36588 invoked by uid 500); 25 Apr 2018 16:30:36 -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 36578 invoked by uid 99); 25 Apr 2018 16:30:36 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Apr 2018 16:30:36 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 28BB7F4DCE; Wed, 25 Apr 2018 16:30:36 +0000 (UTC) From: walterddr To: issues@flink.apache.org Reply-To: issues@flink.apache.org References: In-Reply-To: Subject: [GitHub] flink pull request #5555: [FLINK-8689][table]Add runtime support of distinct... Content-Type: text/plain Message-Id: <20180425163036.28BB7F4DCE@git1-us-west.apache.org> Date: Wed, 25 Apr 2018 16:30:36 +0000 (UTC) Github user walterddr commented on a diff in the pull request: https://github.com/apache/flink/pull/5555#discussion_r184115873 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/codegen/AggregationCodeGenerator.scala --- @@ -151,8 +157,36 @@ class AggregationCodeGenerator( } } - // initialize and create data views - addReusableDataViews() + // get distinct filter of acc fields for each aggregate functions + val distinctAccType = s"${classOf[DistinctAccumulator[_, _]].getName}" + + val distinctAggs: Array[Seq[DataViewSpec[_]]] = isDistinctAggs.zipWithIndex.map { + case (isDistinctAgg, idx) => if (isDistinctAgg) { + val fieldIndex: Int = aggFields(idx)(0) + val mapViewTypeInfo = new MapViewTypeInfo( + physicalInputTypes(fieldIndex), BasicTypeInfo.LONG_TYPE_INFO) --- End diff -- at this moment it will disregard any null value. But as you mention this is not correct. Will address. ---