From commits-return-11460-archive-asf-public=cust-asf.ponee.io@carbondata.apache.org Fri Jun 8 13:40:34 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 557EC1807F2 for ; Fri, 8 Jun 2018 13:40:29 +0200 (CEST) Received: (qmail 45665 invoked by uid 500); 8 Jun 2018 11:40:28 -0000 Mailing-List: contact commits-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 commits@carbondata.apache.org Received: (qmail 45215 invoked by uid 99); 8 Jun 2018 11:40:28 -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; Fri, 08 Jun 2018 11:40:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 40637E118D; Fri, 8 Jun 2018 11:40:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: gvramana@apache.org To: commits@carbondata.apache.org Date: Fri, 08 Jun 2018 11:40:58 -0000 Message-Id: <982f976feea04262a039bd1533abf8b2@git.apache.org> In-Reply-To: <13eb54b7bbc0418c81584fac669303ac@git.apache.org> References: <13eb54b7bbc0418c81584fac669303ac@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [33/50] [abbrv] carbondata git commit: [CARBONDATA-2552]Fix Data Mismatch for Complex Data type Array of Timestamp with Dictionary Include [CARBONDATA-2552]Fix Data Mismatch for Complex Data type Array of Timestamp with Dictionary Include Fix Data Mismatch for Complex Data type Array and Struct of Timestamp with Dictionary Include Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/2993034e Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/2993034e Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/2993034e Branch: refs/heads/spark-2.3 Commit: 2993034e8b4435cf506bd03c73416236b6fb2106 Parents: 8896a63 Author: Indhumathi27 Authored: Mon May 28 22:17:36 2018 +0530 Committer: kumarvishal09 Committed: Tue May 29 17:20:36 2018 +0530 ---------------------------------------------------------------------- .../core/scan/complextypes/PrimitiveQueryType.java | 2 +- .../TestLoadDataWithHiveSyntaxDefaultFormat.scala | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/carbondata/blob/2993034e/core/src/main/java/org/apache/carbondata/core/scan/complextypes/PrimitiveQueryType.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/carbondata/core/scan/complextypes/PrimitiveQueryType.java b/core/src/main/java/org/apache/carbondata/core/scan/complextypes/PrimitiveQueryType.java index 899957e..d7723b3 100644 --- a/core/src/main/java/org/apache/carbondata/core/scan/complextypes/PrimitiveQueryType.java +++ b/core/src/main/java/org/apache/carbondata/core/scan/complextypes/PrimitiveQueryType.java @@ -95,7 +95,7 @@ public class PrimitiveQueryType extends ComplexQueryType implements GenericQuery DimensionRawColumnChunk[] rawColumnChunks, int rowNumber, int pageNumber, DataOutputStream dataOutputStream) throws IOException { byte[] currentVal = copyBlockDataChunk(rawColumnChunks, rowNumber, pageNumber); - if (!this.isDictionary) { + if (!this.isDictionary && !this.isDirectDictionary) { dataOutputStream.writeShort(currentVal.length); } dataOutputStream.write(currentVal); http://git-wip-us.apache.org/repos/asf/carbondata/blob/2993034e/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/dataload/TestLoadDataWithHiveSyntaxDefaultFormat.scala ---------------------------------------------------------------------- diff --git a/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/dataload/TestLoadDataWithHiveSyntaxDefaultFormat.scala b/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/dataload/TestLoadDataWithHiveSyntaxDefaultFormat.scala index d0d578d..7f150be 100644 --- a/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/dataload/TestLoadDataWithHiveSyntaxDefaultFormat.scala +++ b/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/dataload/TestLoadDataWithHiveSyntaxDefaultFormat.scala @@ -365,6 +365,22 @@ class TestLoadDataWithHiveSyntaxDefaultFormat extends QueryTest with BeforeAndAf sql("drop table if exists complexcarbontable") } + test("test Complex Data type - Array and Struct of timestamp with dictionary include") { + sql("DROP TABLE IF EXISTS array_timestamp") + sql( + "create table array_timestamp (date1 array,date2 struct ) stored" + + " by 'carbondata' tblproperties" + + "('dictionary_include'='date1,date2')") + CarbonProperties.getInstance() + .addProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT, "yyyy/MM/dd") + sql("insert into array_timestamp values('2015/01/01$2016/01/01','2017/01/01')") + checkExistence(sql("select * from array_timestamp "), + true, "2015-01-01 00:00:00.0, 2016-01-01 00:00:00.0") + checkExistence(sql("select * from array_timestamp "), + true, "2017-01-01 00:00:00.0") + sql("DROP TABLE IF EXISTS array_timestamp") + } + test("array and string datatype for same column is not working properly") { sql("drop table if exists complexcarbontable") sql("create table complexcarbontable(deviceInformationId int, MAC array, channelsId string, "+