[GitHub] [carbondata] zzcclp commented on a change in pull request #3504: [CARBONDATA-3614] Support Alter table properties set/unset for longstring columns

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

[GitHub] [carbondata] zzcclp commented on a change in pull request #3504: [CARBONDATA-3614] Support Alter table properties set/unset for longstring columns

GitBox
zzcclp commented on a change in pull request #3504: [CARBONDATA-3614] Support Alter table properties set/unset for longstring columns
URL: https://github.com/apache/carbondata/pull/3504#discussion_r355819296
 
 

 ##########
 File path: integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/longstring/VarcharDataTypesBasicTestCase.scala
 ##########
 @@ -191,6 +191,29 @@ class VarcharDataTypesBasicTestCase extends QueryTest with BeforeAndAfterEach wi
     assert(exceptionCaught.getMessage.contains("both in no_inverted_index and long_string_columns"))
   }
 
+  test("test alter table add long string columns with local dictionary") {
+    sql("drop table if exists testlongstring")
+    sql(
+      s"""
+         | CREATE TABLE if not exists testlongstring(id INT, name STRING, description STRING
+         | ) STORED BY 'carbondata'
+         |""".stripMargin)
+    sql("insert into testlongstring select 1, 'ab', 'cool'")
+    checkAnswer(sql("select * from testlongstring"), Seq(Row(1, "ab", "cool")))
+    checkExistence(sql("describe formatted testlongstring"), false, "long_string_columns")
+    //Alter table add table property of long string columns
+    sql("ALTER TABLE testlongstring SET TBLPROPERTIES('long_String_columns'='name,description')")
+    sql("insert into testlongstring select 1, 'ab1', 'not cool'")
 
 Review comment:
   IMO, can use below code to insert data and check data:
   ```
       sql("""insert into testlongstring select 1, "abc" * 12000, 'not cool'""")
       checkAnswer(sql("select * from testlongstring"),
         Seq(Row(1, "ab", "cool"), Row(1, "abc" * 12000, "not cool")))
   ```
   will it take a long time to run CI ?
   
   By the way, it better to add a test case for unsetting long string column, if the length of value of long string column is more than 32000.

----------------------------------------------------------------
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