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 3FA12200D3D for ; Mon, 13 Nov 2017 11:08:40 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 3DF91160BF3; Mon, 13 Nov 2017 10:08:40 +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 AA340160BE4 for ; Mon, 13 Nov 2017 11:08:39 +0100 (CET) Received: (qmail 85006 invoked by uid 500); 13 Nov 2017 10:08:38 -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 84994 invoked by uid 99); 13 Nov 2017 10:08:38 -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; Mon, 13 Nov 2017 10:08:38 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C7AD0DFBC7; Mon, 13 Nov 2017 10:08:38 +0000 (UTC) From: ravipesala To: issues@carbondata.apache.org Reply-To: issues@carbondata.apache.org References: In-Reply-To: Subject: [GitHub] carbondata pull request #1476: [CARBONDATA-1527] [CARBONDATA-1528] [PreAgg] ... Content-Type: text/plain Message-Id: <20171113100838.C7AD0DFBC7@git1-us-west.apache.org> Date: Mon, 13 Nov 2017 10:08:38 +0000 (UTC) archived-at: Mon, 13 Nov 2017 10:08:40 -0000 Github user ravipesala commented on a diff in the pull request: https://github.com/apache/carbondata/pull/1476#discussion_r150493082 --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/preaaggregate/PreAggregateListeners.scala --- @@ -79,3 +79,190 @@ object LoadPostAggregateListener extends OperationEventListener { } } } + +object PreAggregateDataTypeChangePreListener extends OperationEventListener { + /** + * Called on a specified event occurrence + * + * @param event + * @param operationContext + */ + override def onEvent(event: Event, operationContext: OperationContext): Unit = { + val dataTypeChangePreListener = event.asInstanceOf[AlterTableDataTypeChangePreEvent] + val carbonTable = dataTypeChangePreListener.carbonTable + val alterTableDataTypeChangeModel = dataTypeChangePreListener.alterTableDataTypeChangeModel + val columnToBeAltered: String = alterTableDataTypeChangeModel.columnName + val dataMapSchemas = carbonTable.getTableInfo.getDataMapSchemaList + if (dataMapSchemas != null && !dataMapSchemas.isEmpty) { + dataMapSchemas.asScala.foreach { --- End diff -- move to above line ---