[GitHub] carbondata pull request #2042: [CARBONDATA-2236]added sdv test cases for sta...

2018-03-19 Thread asfgit
Github user asfgit closed the pull request at:

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


---


[GitHub] carbondata pull request #2042: [CARBONDATA-2236]added sdv test cases for sta...

2018-03-08 Thread kunal642
Github user kunal642 commented on a diff in the pull request:

https://github.com/apache/carbondata/pull/2042#discussion_r173369924
  
--- Diff: 
integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/StandardPartitionTestCase.scala
 ---
@@ -0,0 +1,436 @@
+/*
+ * 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 partitionTestCase to verify all scenerios
+  */
+
+class StandardPartitionTestCase 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")
+  }
+  //Verify exception if column in partitioned by is already specified in 
table schema
+
+  test("Standard-Partition_TC001", Include) {
+intercept[Exception] {
+  sql(s"""drop table if exists uniqdata""")
+  sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double,INTEGER_COLUMN1 
int) PARTITIONED BY (INTEGER_COLUMN1 int)STORED BY 
'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','LIST_INFO'='1,3')""")
+}
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Verify table is created with Partition
+  test("Standard-Partition_TC002", Include) {
+sql(s"""drop table if exists uniqdata""")
+sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double) PARTITIONED BY 
(INTEGER_COLUMN1 int)STORED BY 'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','LIST_INFO'='1,3')""")
+val df = sql(s"""DESC uniqdata""")
+
assert(df.collect().reverse.head.get(0).toString.toUpperCase.contains("INTEGER_COLUMN1"))
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Verify table is created with Partition with table comment
+
+  test("Standard-Partition_TC003",Include) {
+sql(s"""drop table if exists partition_table""")
+sql(s"""CREATE TABLE partition_table(shortField SHORT, intField INT, 
bigintField LONG, doubleField DOUBLE, decimalField DECIMAL(18,2), charField 
CHAR(5), floatField FLOAT ) COMMENT 'partition_table' PARTITIONED BY 
(stringField STRING) STORED BY 'carbondata'""")
+val df = sql(s"""DESC formatted partition_table""")
+checkExistence(df, true, "partition_table")
+  }
+
+  //Verify WHEN partitioned by is not specified in the DDL, but partition 
type,number of partitions and list info are given
+  test("Standard-Partition_TC004", Include) {
+sql(s"""drop table if exists uniqdata""")
+sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double,INTEGER_COLUMN1 
int) STORED BY 'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','NUM_PARTITIONS'='3','LIST_INFO'='1,3')""")
+assert(true)
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Creating a partition table, with ARRAY type partitioned column
+  test("Standard-Partition_TC005", Include) {
+intercept[Exception] {
+  sql(s"""drop table if exists 

[GitHub] carbondata pull request #2042: [CARBONDATA-2236]added sdv test cases for sta...

2018-03-08 Thread kunal642
Github user kunal642 commented on a diff in the pull request:

https://github.com/apache/carbondata/pull/2042#discussion_r173369580
  
--- Diff: 
integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/StandardPartitionTestCase.scala
 ---
@@ -0,0 +1,436 @@
+/*
+ * 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 partitionTestCase to verify all scenerios
+  */
+
+class StandardPartitionTestCase 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")
+  }
+  //Verify exception if column in partitioned by is already specified in 
table schema
+
+  test("Standard-Partition_TC001", Include) {
+intercept[Exception] {
+  sql(s"""drop table if exists uniqdata""")
+  sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double,INTEGER_COLUMN1 
int) PARTITIONED BY (INTEGER_COLUMN1 int)STORED BY 
'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','LIST_INFO'='1,3')""")
+}
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Verify table is created with Partition
+  test("Standard-Partition_TC002", Include) {
+sql(s"""drop table if exists uniqdata""")
+sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double) PARTITIONED BY 
(INTEGER_COLUMN1 int)STORED BY 'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','LIST_INFO'='1,3')""")
+val df = sql(s"""DESC uniqdata""")
+
assert(df.collect().reverse.head.get(0).toString.toUpperCase.contains("INTEGER_COLUMN1"))
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Verify table is created with Partition with table comment
+
+  test("Standard-Partition_TC003",Include) {
+sql(s"""drop table if exists partition_table""")
+sql(s"""CREATE TABLE partition_table(shortField SHORT, intField INT, 
bigintField LONG, doubleField DOUBLE, decimalField DECIMAL(18,2), charField 
CHAR(5), floatField FLOAT ) COMMENT 'partition_table' PARTITIONED BY 
(stringField STRING) STORED BY 'carbondata'""")
+val df = sql(s"""DESC formatted partition_table""")
+checkExistence(df, true, "partition_table")
+  }
+
+  //Verify WHEN partitioned by is not specified in the DDL, but partition 
type,number of partitions and list info are given
+  test("Standard-Partition_TC004", Include) {
+sql(s"""drop table if exists uniqdata""")
+sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double,INTEGER_COLUMN1 
int) STORED BY 'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','NUM_PARTITIONS'='3','LIST_INFO'='1,3')""")
+assert(true)
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Creating a partition table, with ARRAY type partitioned column
+  test("Standard-Partition_TC005", Include) {
+intercept[Exception] {
+  sql(s"""drop table if exists 

[GitHub] carbondata pull request #2042: [CARBONDATA-2236]added sdv test cases for sta...

2018-03-08 Thread kunal642
Github user kunal642 commented on a diff in the pull request:

https://github.com/apache/carbondata/pull/2042#discussion_r173369404
  
--- Diff: 
integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/StandardPartitionTestCase.scala
 ---
@@ -0,0 +1,436 @@
+/*
+ * 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 partitionTestCase to verify all scenerios
+  */
+
+class StandardPartitionTestCase 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")
+  }
+  //Verify exception if column in partitioned by is already specified in 
table schema
+
+  test("Standard-Partition_TC001", Include) {
+intercept[Exception] {
+  sql(s"""drop table if exists uniqdata""")
+  sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double,INTEGER_COLUMN1 
int) PARTITIONED BY (INTEGER_COLUMN1 int)STORED BY 
'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','LIST_INFO'='1,3')""")
+}
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Verify table is created with Partition
+  test("Standard-Partition_TC002", Include) {
+sql(s"""drop table if exists uniqdata""")
+sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double) PARTITIONED BY 
(INTEGER_COLUMN1 int)STORED BY 'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','LIST_INFO'='1,3')""")
+val df = sql(s"""DESC uniqdata""")
+
assert(df.collect().reverse.head.get(0).toString.toUpperCase.contains("INTEGER_COLUMN1"))
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Verify table is created with Partition with table comment
+
+  test("Standard-Partition_TC003",Include) {
+sql(s"""drop table if exists partition_table""")
+sql(s"""CREATE TABLE partition_table(shortField SHORT, intField INT, 
bigintField LONG, doubleField DOUBLE, decimalField DECIMAL(18,2), charField 
CHAR(5), floatField FLOAT ) COMMENT 'partition_table' PARTITIONED BY 
(stringField STRING) STORED BY 'carbondata'""")
+val df = sql(s"""DESC formatted partition_table""")
+checkExistence(df, true, "partition_table")
+  }
+
+  //Verify WHEN partitioned by is not specified in the DDL, but partition 
type,number of partitions and list info are given
+  test("Standard-Partition_TC004", Include) {
+sql(s"""drop table if exists uniqdata""")
+sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double,INTEGER_COLUMN1 
int) STORED BY 'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','NUM_PARTITIONS'='3','LIST_INFO'='1,3')""")
+assert(true)
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Creating a partition table, with ARRAY type partitioned column
+  test("Standard-Partition_TC005", Include) {
+intercept[Exception] {
+  sql(s"""drop table if exists 

[GitHub] carbondata pull request #2042: [CARBONDATA-2236]added sdv test cases for sta...

2018-03-08 Thread kunal642
Github user kunal642 commented on a diff in the pull request:

https://github.com/apache/carbondata/pull/2042#discussion_r173369982
  
--- Diff: 
integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/StandardPartitionTestCase.scala
 ---
@@ -0,0 +1,436 @@
+/*
+ * 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 partitionTestCase to verify all scenerios
+  */
+
+class StandardPartitionTestCase 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")
+  }
+  //Verify exception if column in partitioned by is already specified in 
table schema
+
+  test("Standard-Partition_TC001", Include) {
+intercept[Exception] {
+  sql(s"""drop table if exists uniqdata""")
+  sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double,INTEGER_COLUMN1 
int) PARTITIONED BY (INTEGER_COLUMN1 int)STORED BY 
'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','LIST_INFO'='1,3')""")
+}
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Verify table is created with Partition
+  test("Standard-Partition_TC002", Include) {
+sql(s"""drop table if exists uniqdata""")
+sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double) PARTITIONED BY 
(INTEGER_COLUMN1 int)STORED BY 'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','LIST_INFO'='1,3')""")
+val df = sql(s"""DESC uniqdata""")
+
assert(df.collect().reverse.head.get(0).toString.toUpperCase.contains("INTEGER_COLUMN1"))
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Verify table is created with Partition with table comment
+
+  test("Standard-Partition_TC003",Include) {
+sql(s"""drop table if exists partition_table""")
+sql(s"""CREATE TABLE partition_table(shortField SHORT, intField INT, 
bigintField LONG, doubleField DOUBLE, decimalField DECIMAL(18,2), charField 
CHAR(5), floatField FLOAT ) COMMENT 'partition_table' PARTITIONED BY 
(stringField STRING) STORED BY 'carbondata'""")
+val df = sql(s"""DESC formatted partition_table""")
+checkExistence(df, true, "partition_table")
+  }
+
+  //Verify WHEN partitioned by is not specified in the DDL, but partition 
type,number of partitions and list info are given
+  test("Standard-Partition_TC004", Include) {
+sql(s"""drop table if exists uniqdata""")
+sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double,INTEGER_COLUMN1 
int) STORED BY 'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','NUM_PARTITIONS'='3','LIST_INFO'='1,3')""")
+assert(true)
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Creating a partition table, with ARRAY type partitioned column
+  test("Standard-Partition_TC005", Include) {
+intercept[Exception] {
+  sql(s"""drop table if exists 

[GitHub] carbondata pull request #2042: [CARBONDATA-2236]added sdv test cases for sta...

2018-03-08 Thread kunal642
Github user kunal642 commented on a diff in the pull request:

https://github.com/apache/carbondata/pull/2042#discussion_r173367821
  
--- Diff: 
integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/StandardPartitionTestCase.scala
 ---
@@ -0,0 +1,436 @@
+/*
+ * 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 partitionTestCase to verify all scenerios
+  */
+
+class StandardPartitionTestCase 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")
+  }
+  //Verify exception if column in partitioned by is already specified in 
table schema
+
+  test("Standard-Partition_TC001", Include) {
+intercept[Exception] {
+  sql(s"""drop table if exists uniqdata""")
+  sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double,INTEGER_COLUMN1 
int) PARTITIONED BY (INTEGER_COLUMN1 int)STORED BY 
'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','LIST_INFO'='1,3')""")
+}
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Verify table is created with Partition
+  test("Standard-Partition_TC002", Include) {
+sql(s"""drop table if exists uniqdata""")
+sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double) PARTITIONED BY 
(INTEGER_COLUMN1 int)STORED BY 'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','LIST_INFO'='1,3')""")
+val df = sql(s"""DESC uniqdata""")
+
assert(df.collect().reverse.head.get(0).toString.toUpperCase.contains("INTEGER_COLUMN1"))
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Verify table is created with Partition with table comment
+
+  test("Standard-Partition_TC003",Include) {
+sql(s"""drop table if exists partition_table""")
+sql(s"""CREATE TABLE partition_table(shortField SHORT, intField INT, 
bigintField LONG, doubleField DOUBLE, decimalField DECIMAL(18,2), charField 
CHAR(5), floatField FLOAT ) COMMENT 'partition_table' PARTITIONED BY 
(stringField STRING) STORED BY 'carbondata'""")
+val df = sql(s"""DESC formatted partition_table""")
+checkExistence(df, true, "partition_table")
+  }
+
+  //Verify WHEN partitioned by is not specified in the DDL, but partition 
type,number of partitions and list info are given
+  test("Standard-Partition_TC004", Include) {
+sql(s"""drop table if exists uniqdata""")
+sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double,INTEGER_COLUMN1 
int) STORED BY 'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','NUM_PARTITIONS'='3','LIST_INFO'='1,3')""")
+assert(true)
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Creating a partition table, with ARRAY type partitioned column
+  test("Standard-Partition_TC005", Include) {
+intercept[Exception] {
+  sql(s"""drop table if exists 

[GitHub] carbondata pull request #2042: [CARBONDATA-2236]added sdv test cases for sta...

2018-03-08 Thread kunal642
Github user kunal642 commented on a diff in the pull request:

https://github.com/apache/carbondata/pull/2042#discussion_r173367335
  
--- Diff: 
integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/StandardPartitionTestCase.scala
 ---
@@ -0,0 +1,436 @@
+/*
+ * 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 partitionTestCase to verify all scenerios
+  */
+
+class StandardPartitionTestCase 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")
+  }
+  //Verify exception if column in partitioned by is already specified in 
table schema
+
+  test("Standard-Partition_TC001", Include) {
+intercept[Exception] {
+  sql(s"""drop table if exists uniqdata""")
+  sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double,INTEGER_COLUMN1 
int) PARTITIONED BY (INTEGER_COLUMN1 int)STORED BY 
'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','LIST_INFO'='1,3')""")
--- End diff --

remove carbon partition syntax from all test cases


---


[GitHub] carbondata pull request #2042: [CARBONDATA-2236]added sdv test cases for sta...

2018-03-08 Thread kunal642
Github user kunal642 commented on a diff in the pull request:

https://github.com/apache/carbondata/pull/2042#discussion_r173373691
  
--- Diff: 
integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/StandardPartitionTestCase.scala
 ---
@@ -0,0 +1,436 @@
+/*
+ * 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 partitionTestCase to verify all scenerios
+  */
+
+class StandardPartitionTestCase 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")
+  }
+  //Verify exception if column in partitioned by is already specified in 
table schema
+
+  test("Standard-Partition_TC001", Include) {
+intercept[Exception] {
+  sql(s"""drop table if exists uniqdata""")
+  sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double,INTEGER_COLUMN1 
int) PARTITIONED BY (INTEGER_COLUMN1 int)STORED BY 
'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','LIST_INFO'='1,3')""")
+}
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Verify table is created with Partition
+  test("Standard-Partition_TC002", Include) {
+sql(s"""drop table if exists uniqdata""")
+sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double) PARTITIONED BY 
(INTEGER_COLUMN1 int)STORED BY 'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','LIST_INFO'='1,3')""")
+val df = sql(s"""DESC uniqdata""")
+
assert(df.collect().reverse.head.get(0).toString.toUpperCase.contains("INTEGER_COLUMN1"))
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Verify table is created with Partition with table comment
+
+  test("Standard-Partition_TC003",Include) {
+sql(s"""drop table if exists partition_table""")
+sql(s"""CREATE TABLE partition_table(shortField SHORT, intField INT, 
bigintField LONG, doubleField DOUBLE, decimalField DECIMAL(18,2), charField 
CHAR(5), floatField FLOAT ) COMMENT 'partition_table' PARTITIONED BY 
(stringField STRING) STORED BY 'carbondata'""")
+val df = sql(s"""DESC formatted partition_table""")
+checkExistence(df, true, "partition_table")
+  }
+
+  //Verify WHEN partitioned by is not specified in the DDL, but partition 
type,number of partitions and list info are given
+  test("Standard-Partition_TC004", Include) {
+sql(s"""drop table if exists uniqdata""")
+sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double,INTEGER_COLUMN1 
int) STORED BY 'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','NUM_PARTITIONS'='3','LIST_INFO'='1,3')""")
+assert(true)
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Creating a partition table, with ARRAY type partitioned column
+  test("Standard-Partition_TC005", Include) {
+intercept[Exception] {
+  sql(s"""drop table if exists 

[GitHub] carbondata pull request #2042: [CARBONDATA-2236]added sdv test cases for sta...

2018-03-08 Thread kunal642
Github user kunal642 commented on a diff in the pull request:

https://github.com/apache/carbondata/pull/2042#discussion_r173367883
  
--- Diff: 
integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/StandardPartitionTestCase.scala
 ---
@@ -0,0 +1,436 @@
+/*
+ * 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 partitionTestCase to verify all scenerios
+  */
+
+class StandardPartitionTestCase 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")
+  }
+  //Verify exception if column in partitioned by is already specified in 
table schema
+
+  test("Standard-Partition_TC001", Include) {
+intercept[Exception] {
+  sql(s"""drop table if exists uniqdata""")
--- End diff --

move drop command outside intercept block from all tests


---


[GitHub] carbondata pull request #2042: [CARBONDATA-2236]added sdv test cases for sta...

2018-03-08 Thread kunal642
Github user kunal642 commented on a diff in the pull request:

https://github.com/apache/carbondata/pull/2042#discussion_r173369434
  
--- Diff: 
integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/StandardPartitionTestCase.scala
 ---
@@ -0,0 +1,436 @@
+/*
+ * 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 partitionTestCase to verify all scenerios
+  */
+
+class StandardPartitionTestCase 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")
+  }
+  //Verify exception if column in partitioned by is already specified in 
table schema
+
+  test("Standard-Partition_TC001", Include) {
+intercept[Exception] {
+  sql(s"""drop table if exists uniqdata""")
+  sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double,INTEGER_COLUMN1 
int) PARTITIONED BY (INTEGER_COLUMN1 int)STORED BY 
'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','LIST_INFO'='1,3')""")
+}
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Verify table is created with Partition
+  test("Standard-Partition_TC002", Include) {
+sql(s"""drop table if exists uniqdata""")
+sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double) PARTITIONED BY 
(INTEGER_COLUMN1 int)STORED BY 'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','LIST_INFO'='1,3')""")
+val df = sql(s"""DESC uniqdata""")
+
assert(df.collect().reverse.head.get(0).toString.toUpperCase.contains("INTEGER_COLUMN1"))
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Verify table is created with Partition with table comment
+
+  test("Standard-Partition_TC003",Include) {
+sql(s"""drop table if exists partition_table""")
+sql(s"""CREATE TABLE partition_table(shortField SHORT, intField INT, 
bigintField LONG, doubleField DOUBLE, decimalField DECIMAL(18,2), charField 
CHAR(5), floatField FLOAT ) COMMENT 'partition_table' PARTITIONED BY 
(stringField STRING) STORED BY 'carbondata'""")
+val df = sql(s"""DESC formatted partition_table""")
+checkExistence(df, true, "partition_table")
+  }
+
+  //Verify WHEN partitioned by is not specified in the DDL, but partition 
type,number of partitions and list info are given
+  test("Standard-Partition_TC004", Include) {
+sql(s"""drop table if exists uniqdata""")
+sql(s"""CREATE TABLE uniqdata (CUST_ID int,CUST_NAME 
String,ACTIVE_EMUI_VERSION string, DOB timestamp, BIGINT_COLUMN1 
bigint,BIGINT_COLUMN2 bigint,DECIMAL_COLUMN1 decimal(30,10), DECIMAL_COLUMN2 
decimal(36,10),Double_COLUMN1 double, Double_COLUMN2 double,INTEGER_COLUMN1 
int) STORED BY 'org.apache.carbondata.format' 
TBLPROPERTIES('PARTITION_TYPE'='List','NUM_PARTITIONS'='3','LIST_INFO'='1,3')""")
+assert(true)
+sql(s"""drop table if exists uniqdata""")
+  }
+
+  //Creating a partition table, with ARRAY type partitioned column
+  test("Standard-Partition_TC005", Include) {
+intercept[Exception] {
+  sql(s"""drop table if exists 

[GitHub] carbondata pull request #2042: [CARBONDATA-2236]added sdv test cases for sta...

2018-03-07 Thread praveenmeenakshi56
GitHub user praveenmeenakshi56 opened a pull request:

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

[CARBONDATA-2236]added sdv test cases for standard partition

added sdv test cases for standard partition
Be sure to do all of the following checklist to help us incorporate 
your contribution quickly and easily:

 - [ ] Any interfaces changed?
 
 - [ ] Any backward compatibility impacted?
 
 - [ ] Document update required?

 - [ ] 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.
   
 - [ ] For large changes, please consider breaking it into sub-tasks under 
an umbrella JIRA. 



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

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

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

https://github.com/apache/carbondata/pull/2042.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 #2042


commit 718af59351368db4577be1cad4808b9d789abf72
Author: praveenmeenakshi56 
Date:   2018-03-07T15:02:39Z

added sdv test cases for standard partition




---