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 927ED200D62 for ; Sat, 16 Dec 2017 09:18:17 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 90FD2160C11; Sat, 16 Dec 2017 08:18:17 +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 09275160BFB for ; Sat, 16 Dec 2017 09:18:16 +0100 (CET) Received: (qmail 51779 invoked by uid 500); 16 Dec 2017 08:18:16 -0000 Mailing-List: contact issues-help@carbondata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@carbondata.apache.org Delivered-To: mailing list issues@carbondata.apache.org Received: (qmail 51770 invoked by uid 99); 16 Dec 2017 08:18:16 -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; Sat, 16 Dec 2017 08:18:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1B38BDFDE6; Sat, 16 Dec 2017 08:18:16 +0000 (UTC) From: ravipesala To: issues@carbondata.apache.org Reply-To: issues@carbondata.apache.org References: In-Reply-To: Subject: [GitHub] carbondata pull request #1671: [CARBONDATA-1901]Fixed Pre aggregate data map... Content-Type: text/plain Message-Id: <20171216081816.1B38BDFDE6@git1-us-west.apache.org> Date: Sat, 16 Dec 2017 08:18:16 +0000 (UTC) archived-at: Sat, 16 Dec 2017 08:18:17 -0000 Github user ravipesala commented on a diff in the pull request: https://github.com/apache/carbondata/pull/1671#discussion_r157337178 --- Diff: integration/spark-common/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala --- @@ -514,17 +514,40 @@ class TableNewProcessor(cm: TableModel) { } cm.msrCols.foreach { field => - val encoders = new java.util.ArrayList[Encoding]() + // if aggregate function is defined in case of preaggregate and agg function is sum or avg + // then it can be stored as measure + var isAggFunPresent = false + // getting the encoder from maintable so whatever encoding is applied in maintable + // same encoder can be applied on aggregate table + val encoders = if (cm.parentTable.isDefined && cm.dataMapRelation.get.get(field).isDefined) { + isAggFunPresent = + cm.dataMapRelation.get.get(field).get.aggregateFunction.equalsIgnoreCase("sum") || + cm.dataMapRelation.get.get(field).get.aggregateFunction.equals("avg") --- End diff -- How about count aggregate? ---