[GitHub] carbondata pull request #2175: [CARBONDATA-2352] Added SDV test cases for Pa...

2018-05-10 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/carbondata/pull/2175


---


[GitHub] carbondata pull request #2175: [CARBONDATA-2352] Added SDV test cases for Pa...

2018-05-07 Thread kunal642
Github user kunal642 commented on a diff in the pull request:

https://github.com/apache/carbondata/pull/2175#discussion_r186616874
  
--- Diff: 
integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/PartitionWithPreAggregateTestCase.scala
 ---
@@ -0,0 +1,129 @@
+/*
+ * 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(s"""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')""")
+sql(s"""load data inpath 
'$resourcesPath/Data/partition/list_partition_table.csv' into table 
partition_table""")
+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 count(*) from partition_table"""), 
Seq(Row(10)))
+  }
+  //Loading data into partitioned table with SORT_SCOPE=GLOBAL_SORT
+  test("Partition-With-PreAggregate_TC002", Include) {
+sql(s"""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')""")
+sql(s"""load data inpath 
'$resourcesPath/Data/partition/list_partition_table.csv' into table 
partition_table""")
+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 count(*) from partition_table"""), 
Seq(Row(10)))
+  }
+  //Loading data into partitioned table with SORT_SCOPE=BATCH_SORT
+  test("Partition-With-PreAggregate_TC003", Include) {
+sql(s"""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'='BATCH_SORT')""")
+sql(s"""load data inpath 
'$resourcesPath/Data/partition/list_partition_table.csv' into table 
partition_table""")
+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 count(*) from partition_table"""), 
Seq(Row(10)))
+  }
+  //Loading data into partitioned table with SORT_SCOPE=NO_SORT
+  test("Partition-With-PreAggregate_TC004", Include) {
+sql(s"""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 

[GitHub] carbondata pull request #2175: [CARBONDATA-2352] Added SDV test cases for Pa...

2018-05-07 Thread kunal642
Github user kunal642 commented on a diff in the pull request:

https://github.com/apache/carbondata/pull/2175#discussion_r186616811
  
--- Diff: 
integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/PartitionWithPreAggregateTestCase.scala
 ---
@@ -0,0 +1,129 @@
+/*
+ * 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(s"""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')""")
+sql(s"""load data inpath 
'$resourcesPath/Data/partition/list_partition_table.csv' into table 
partition_table""")
+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 count(*) from partition_table"""), 
Seq(Row(10)))
--- End diff --

Please compare actual results instead of count


---


[GitHub] carbondata pull request #2175: [CARBONDATA-2352] Added SDV test cases for Pa...

2018-04-16 Thread praveenmeenakshi56
GitHub user praveenmeenakshi56 opened a pull request:

https://github.com/apache/carbondata/pull/2175

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

Dependent on PR's 2147, 2166

 - [ ] Any interfaces changed?
 NA
 - [ ] Any backward compatibility impacted?
 NA
 - [ ] Document update required?
NA
 - [ ] Testing done
Please provide details on 
- Whether new unit test cases have been added or why no new tests 
are required?
- How it is tested? Please attach test report.
- Is it a performance related change? Please attach the performance 
test report.
- Any additional information to help reviewers in testing this 
change.
NA  
 - [ ] For large changes, please consider breaking it into sub-tasks under 
an umbrella JIRA. 
NA


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/praveenmeenakshi56/carbondata part_preagg_sdv

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/carbondata/pull/2175.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #2175


commit 011a5b1c75d5390518c9c086f02d6f9d44415ca3
Author: praveenmeenakshi56 
Date:   2018-04-16T09:44:20Z

Added SDV test cases for Partition with Pre-Aggregate table




---