You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2019/01/23 11:23:06 UTC

[GitHub] NamanRastogi commented on a change in pull request #3094: [CARBONDATA-3264] Added SORT_SCOPE in ALTER TABLE SET

NamanRastogi commented on a change in pull request #3094: [CARBONDATA-3264] Added SORT_SCOPE in ALTER TABLE SET
URL: https://github.com/apache/carbondata/pull/3094#discussion_r250153724
 
 

 ##########
 File path: integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/AlterTableTestCase.scala
 ##########
 @@ -1016,6 +1016,62 @@ class AlterTableTestCase extends QueryTest with BeforeAndAfterAll {
     }
   }
 
+
+  test("AlterTable Change Sort Scope 1") {
+    sql("DROP TABLE IF EXISTS t1")
+    sql(s"CREATE TABLE t1(age int, name string) STORED BY 'carbondata' TBLPROPERTIES" +
+        s"('sort_scope'='local_sort', 'sort_columns'='age')")
+    sql("ALTER TABLE t1 SET TBLPROPERTIES('sort_scope'='batch_sort')")
+
+    var sort_scope: String = ""
+    sql("DESCRIBE FORMATTED t1").collect().foreach(row => {
+      if (row.getAs[String]("col_name").equalsIgnoreCase("sort scope")) {
+        sort_scope = row.getAs[String]("data_type")
+      }
+    })
+    assert(sort_scope.equalsIgnoreCase("batch_sort"))
+    sql("DROP TABLE t1")
+  }
+
+  test("AlterTable Change Sort Scope 2") {
+    sql("DROP TABLE IF EXISTS t1")
+    sql(s"CREATE TABLE t1(age int, name string) STORED BY 'carbondata' TBLPROPERTIES" +
+        s"('sort_columns'='')")
+    sql("ALTER TABLE t1 SET TBLPROPERTIES('sort_scope'='local_sort')")
 
 Review comment:
   Done.

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


With regards,
Apache Git Services