[GitHub] [carbondata] kevinjmh commented on a change in pull request #3214: [CARBONDATA-3382] Fixed compressor type display in desc formatted

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] kevinjmh commented on a change in pull request #3214: [CARBONDATA-3382] Fixed compressor type display in desc formatted

GitBox
kevinjmh commented on a change in pull request #3214: [CARBONDATA-3382] Fixed compressor type display in desc formatted
URL: https://github.com/apache/carbondata/pull/3214#discussion_r286062117
 
 

 ##########
 File path: integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/describeTable/TestDescribeTable.scala
 ##########
 @@ -65,10 +68,21 @@ class TestDescribeTable extends QueryTest with BeforeAndAfterAll {
     assert(descPar.exists(_.toString().contains("Partition Parameters:")))
   }
 
+  test(testName = "Compressor Type update from carbon properties") {
+    sql("drop table if exists b")
+    sql(sqlText = "create table b(a int,b string) stored by 'carbondata'")
+    CarbonProperties.getInstance().addProperty(CarbonCommonConstants.COMPRESSOR, "gzip")
+    val result = sql(sqlText = "desc formatted b").collect()
+    assert(result.filter(row => row.getString(0).contains("Data File Compressor")).head.getString
+    (1).equalsIgnoreCase("gzip"))
+  }
+
   override def afterAll: Unit = {
     sql("DROP TABLE Desc1")
     sql("DROP TABLE Desc2")
     sql("drop table if exists a")
+    sql("drop table if exists b")
+    CarbonProperties.getInstance().addProperty(CarbonCommonConstants.COMPRESSOR, "snappy")
 
 Review comment:
   but user may misunderstanding this. so we better distinguish it from what it was and what it will be.
   
   For table which has not this properties, if you want to show what compressor will be uses, need to tell user both that this table is not set compress and what the default setting is

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services