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

    https://github.com/apache/carbondata/pull/2436#discussion_r200896241
  
    --- Diff: 
integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/longstring/VarcharDataTypesBasicTestCase.scala
 ---
    @@ -133,6 +133,64 @@ class VarcharDataTypesBasicTestCase extends QueryTest 
with BeforeAndAfterEach wi
         assert(exceptionCaught.getMessage.contains("its data type is not 
string"))
       }
     
    +  test("long string columns cannot contain duplicate columns") {
    +    val exceptionCaught = intercept[Exception] {
    +      sql(
    +        s"""
    +           | CREATE TABLE if not exists $longStringTable(
    +           | id INT, name STRING, description STRING, address STRING, note 
STRING
    +           | ) STORED BY 'carbondata'
    +           | TBLPROPERTIES('LONG_STRING_COLUMNS'='address, note, Note')
    +           |""".
    +          stripMargin)
    +    }
    +    assert(exceptionCaught.getMessage.contains("long_string_columns"))
    +    assert(exceptionCaught.getMessage.contains("Duplicate columns are not 
allowed"))
    +  }
    +
    +  test("long_string_columns: column does not exist in table ") {
    +    val exceptionCaught = intercept[Exception] {
    +      sql(
    +        s"""
    +           | CREATE TABLE if not exists $longStringTable(
    +           | id INT, name STRING, description STRING, address STRING, note 
STRING
    +           | ) STORED BY 'carbondata'
    +           | TBLPROPERTIES('LONG_STRING_COLUMNS'='address, note, NoteS')
    +           |""".
    +          stripMargin)
    +    }
    +    assert(exceptionCaught.getMessage.contains("long_string_columns"))
    +    assert(exceptionCaught.getMessage.contains("does not exist in table"))
    +  }
    +
    +  test("long_string_columns: columns cannot exist in patitions columns") {
    +    val exceptionCaught = intercept[Exception] {
    +      sql(
    +        s"""
    +           | CREATE TABLE if not exists $longStringTable(
    +           | id INT, name STRING, description STRING, address STRING
    +           | ) partitioned by (note string) STORED BY 'carbondata'
    +           | TBLPROPERTIES('LONG_STRING_COLUMNS'='note')
    +           |""".
    +          stripMargin)
    +    }
    +    assert(exceptionCaught.getMessage.contains("both in partition and 
long_string_columns"))
    +  }
    +
    +  test("long_string_columns: columns cannot exist in no_inverted_index 
columns") {
    +    val exceptionCaught = intercept[Exception] {
    --- End diff --
    
    please be more specific about the Exception, do not just intercept all 
Exception


---

Reply via email to