[13/50] [abbrv] carbondata git commit: [CARBONDATA-2352] Added SDV test cases for Partition with Pre-Aggregate table

2018-05-17 Thread manishgupta88
[CARBONDATA-2352] Added SDV test cases for Partition with Pre-Aggregate table

Added SDV test cases for Support of partitioning with Pre-Aggregate tables.

This closes #2175


Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/cc0cbbac
Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/cc0cbbac
Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/cc0cbbac

Branch: refs/heads/spark-2.3
Commit: cc0cbbac7dca8f14904f231df16a524c07c9af5f
Parents: e70b6b4
Author: praveenmeenakshi56 
Authored: Mon Apr 16 15:14:20 2018 +0530
Committer: kunal642 
Committed: Thu May 10 12:49:39 2018 +0530

--
 .../PartitionWithPreAggregateTestCase.scala | 275 +++
 .../cluster/sdv/suite/SDVSuites.scala   |   6 +-
 2 files changed, 279 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/carbondata/blob/cc0cbbac/integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/PartitionWithPreAggregateTestCase.scala
--
diff --git 
a/integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/PartitionWithPreAggregateTestCase.scala
 
b/integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/PartitionWithPreAggregateTestCase.scala
new file mode 100644
index 000..87f5fda
--- /dev/null
+++ 
b/integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/PartitionWithPreAggregateTestCase.scala
@@ -0,0 +1,275 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.carbondata.cluster.sdv.generated
+import org.apache.carbondata.core.constants.CarbonCommonConstants
+import org.apache.carbondata.core.util.CarbonProperties
+import org.apache.spark.sql.Row
+import org.apache.spark.sql.common.util._
+import org.scalatest.BeforeAndAfterAll
+/**
+  * Test Class for Support of Partition with PreAggregate table
+  */
+class PartitionWithPreAggregateTestCase extends QueryTest with 
BeforeAndAfterAll {
+  override def beforeAll = {
+CarbonProperties.getInstance()
+  .addProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT, "/MM/dd 
HH:mm:ss")
+  .addProperty(CarbonCommonConstants.CARBON_DATE_FORMAT, "/MM/dd")
+  }
+
+  //Loading data into partitioned table with SORT_SCOPE=LOCAL_SORT
+  test("Partition-With-PreAggregate_TC001", Include) {
+sql("drop table if exists partition_table")
+sql(
+  s"""CREATE TABLE partition_table(shortField SHORT, intField INT, 
bigintField LONG,
+ |doubleField DOUBLE, timestamp TIMESTAMP, decimalField 
DECIMAL(18,2),dateField DATE,
+ |charField CHAR(5), floatField FLOAT ) PARTITIONED BY (stringField 
STRING) STORED BY
+ |'carbondata' TBLPROPERTIES('SORT_SCOPE'='LOCAL_SORT')""".stripMargin)
+sql(
+  s"""load data inpath 
'$resourcesPath/Data/partition/list_partition_table.csv' into table
+ |partition_table""".stripMargin)
+sql(
+  "create datamap ag1 on table partition_table using 'preaggregate' as 
select shortField, sum" +
+  "(intField) from partition_table group by shortField")
+checkAnswer(sql(
+  s"""select decimalfield from partition_table where charfield='e' and
+ |floatfield=307.301 group by decimalfield limit 1""".stripMargin),
+  Seq(Row(159.10)))
+  }
+
+  //Loading data into partitioned table with SORT_SCOPE=GLOBAL_SORT
+  test("Partition-With-PreAggregate_TC002", Include) {
+sql("drop table if exists partition_table")
+sql(
+  s"""CREATE TABLE partition_table(shortField SHORT, intField INT, 
bigintField LONG,
+ |doubleField DOUBLE, timestamp TIMESTAMP, decimalField 
DECIMAL(18,2),dateField DATE,
+ |charField CHAR(5), floatField FLOAT ) PARTITIONED BY (stringField 
STRING) STORED BY
+ |'carbondata' 
TBLPROPERTIES('SORT_SCOPE'='GLOBAL_SORT')""".stripMargin)
+

carbondata git commit: [CARBONDATA-2352] Added SDV test cases for Partition with Pre-Aggregate table

2018-05-10 Thread kunalkapoor
Repository: carbondata
Updated Branches:
  refs/heads/master e70b6b446 -> cc0cbbac7


[CARBONDATA-2352] Added SDV test cases for Partition with Pre-Aggregate table

Added SDV test cases for Support of partitioning with Pre-Aggregate tables.

This closes #2175


Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/cc0cbbac
Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/cc0cbbac
Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/cc0cbbac

Branch: refs/heads/master
Commit: cc0cbbac7dca8f14904f231df16a524c07c9af5f
Parents: e70b6b4
Author: praveenmeenakshi56 
Authored: Mon Apr 16 15:14:20 2018 +0530
Committer: kunal642 
Committed: Thu May 10 12:49:39 2018 +0530

--
 .../PartitionWithPreAggregateTestCase.scala | 275 +++
 .../cluster/sdv/suite/SDVSuites.scala   |   6 +-
 2 files changed, 279 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/carbondata/blob/cc0cbbac/integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/PartitionWithPreAggregateTestCase.scala
--
diff --git 
a/integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/PartitionWithPreAggregateTestCase.scala
 
b/integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/PartitionWithPreAggregateTestCase.scala
new file mode 100644
index 000..87f5fda
--- /dev/null
+++ 
b/integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/PartitionWithPreAggregateTestCase.scala
@@ -0,0 +1,275 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.carbondata.cluster.sdv.generated
+import org.apache.carbondata.core.constants.CarbonCommonConstants
+import org.apache.carbondata.core.util.CarbonProperties
+import org.apache.spark.sql.Row
+import org.apache.spark.sql.common.util._
+import org.scalatest.BeforeAndAfterAll
+/**
+  * Test Class for Support of Partition with PreAggregate table
+  */
+class PartitionWithPreAggregateTestCase extends QueryTest with 
BeforeAndAfterAll {
+  override def beforeAll = {
+CarbonProperties.getInstance()
+  .addProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT, "/MM/dd 
HH:mm:ss")
+  .addProperty(CarbonCommonConstants.CARBON_DATE_FORMAT, "/MM/dd")
+  }
+
+  //Loading data into partitioned table with SORT_SCOPE=LOCAL_SORT
+  test("Partition-With-PreAggregate_TC001", Include) {
+sql("drop table if exists partition_table")
+sql(
+  s"""CREATE TABLE partition_table(shortField SHORT, intField INT, 
bigintField LONG,
+ |doubleField DOUBLE, timestamp TIMESTAMP, decimalField 
DECIMAL(18,2),dateField DATE,
+ |charField CHAR(5), floatField FLOAT ) PARTITIONED BY (stringField 
STRING) STORED BY
+ |'carbondata' TBLPROPERTIES('SORT_SCOPE'='LOCAL_SORT')""".stripMargin)
+sql(
+  s"""load data inpath 
'$resourcesPath/Data/partition/list_partition_table.csv' into table
+ |partition_table""".stripMargin)
+sql(
+  "create datamap ag1 on table partition_table using 'preaggregate' as 
select shortField, sum" +
+  "(intField) from partition_table group by shortField")
+checkAnswer(sql(
+  s"""select decimalfield from partition_table where charfield='e' and
+ |floatfield=307.301 group by decimalfield limit 1""".stripMargin),
+  Seq(Row(159.10)))
+  }
+
+  //Loading data into partitioned table with SORT_SCOPE=GLOBAL_SORT
+  test("Partition-With-PreAggregate_TC002", Include) {
+sql("drop table if exists partition_table")
+sql(
+  s"""CREATE TABLE partition_table(shortField SHORT, intField INT, 
bigintField LONG,
+ |doubleField DOUBLE, timestamp TIMESTAMP, decimalField 
DECIMAL(18,2),dateField DATE,
+ |charField CHAR(5), floatField FLOAT ) PARTITIONED BY (stringField 
STRING) STORED BY
+