ajantha-bhat commented on a change in pull request #3553: [CARBONDATA-3648] 
Support Alter Table Compaction Level Threshold
URL: https://github.com/apache/carbondata/pull/3553#discussion_r363570106
 
 

 ##########
 File path: 
integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/alterTable/TestAlterTableCompactionLevel.scala
 ##########
 @@ -0,0 +1,58 @@
+/*
+ * 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.spark.testsuite.alterTable
+
+import org.apache.spark.sql.CarbonEnv
+import org.apache.spark.sql.test.util.QueryTest
+import org.scalatest.BeforeAndAfterAll
+
+/**
+ * test class for validating alter table set properties with 
alter_compaction_level properties
+ */
+class TestAlterTableCompactionLevel extends QueryTest with BeforeAndAfterAll {
+
+  private def isExpectedValueValid(dbName: String,
+                                   tableName: String,
+                                   key: String,
+                                   expectedValue: String): Boolean = {
+    val carbonTable = CarbonEnv.getCarbonTable(Option(dbName), 
tableName)(sqlContext.sparkSession)
+    val value = 
carbonTable.getTableInfo.getFactTable.getTableProperties.get(key)
+    expectedValue.equals(value)
+  }
+
+  private def dropTable = {
+    sql("drop table if exists alter_compaction_level")
+  }
+
+  override def beforeAll {
+    // drop table
+    dropTable
+    // create table
+    sql("create table alter_compaction_level(c1 String) stored by 
'carbondata'")
+  }
+
+  test("validate alter compaction level") {
 
 Review comment:
   can you add a test case for more than 10000 threshold?
   
   As now there is no validation is present, it will pass !!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to