Github user akashrn5 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2469#discussion_r201264662
  
    --- Diff: 
integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/localdictionary/LocalDictionarySupportAlterTableTest.scala
 ---
    @@ -1161,6 +1159,126 @@ class LocalDictionarySupportAlterTableTest extends 
QueryTest with BeforeAndAfter
         }
       }
     
    +  test("test alter for local dictionary for complex columns when local 
dictionary exclude is defined _001") {
    +    sql("drop table if exists local1")
    +    sql(
    +      """
    +        | CREATE TABLE local1(id int, name string,city string, st 
array<struct<si:int,sd:string>>)
    +        | STORED BY 'org.apache.carbondata.format'
    +        | 
tblproperties('long_string_columns'='name','local_dictionary_enable'='true')
    +      """.stripMargin)
    +    sql("alter table local1 set 
tblproperties('local_dictionary_exclude'='st,name')")
    +    val descLoc = sql("describe formatted local1").collect
    +    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) 
match {
    +      case Some(row) => assert(row.get(1).toString.contains("10000"))
    +    }
    +    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) 
match {
    +      case Some(row) => assert(row.get(1).toString.contains("true"))
    +    }
    +    descLoc.find(_.get(0).toString.contains("Local Dictionary Exclude")) 
match {
    +      case Some(row) => 
assert(row.get(1).toString.contains("st.val.sd,name"))
    +    }
    +  }
    +
    +  test("test alter for local dictionary for complex columns when local 
dictionary exclude is defined _002") {
    +    sql("drop table if exists local1")
    +    sql(
    +      """
    +        | CREATE TABLE local1(id int, name string,city string, st 
array<struct<si:int,sd:string>>,f string,g int,h string)
    +        | STORED BY 'org.apache.carbondata.format'
    +        | 
tblproperties('long_string_columns'='name','local_dictionary_enable'='true','local_dictionary_include'='st')
    +      """.stripMargin)
    +    sql("alter table local1 unset 
tblproperties('local_dictionary_include')")
    +    sql("alter table local1 set 
tblproperties('local_dictionary_exclude'='st,name,h')")
    +    val descLoc = sql("describe formatted local1").collect
    +    descLoc.find(_.get(0).toString.contains("Local Dictionary Threshold")) 
match {
    +      case Some(row) => assert(row.get(1).toString.contains("10000"))
    +    }
    +    descLoc.find(_.get(0).toString.contains("Local Dictionary Enabled")) 
match {
    +      case Some(row) => assert(row.get(1).toString.contains("true"))
    +    }
    +    descLoc.find(_.get(0).toString.contains("Local Dictionary Exclude")) 
match {
    +      case Some(row) => 
assert(row.get(1).toString.contains("h,st.val.sd,name"))
    --- End diff --
    
    add all the child excluded columns in the check


---

Reply via email to