Github user sounakr commented on a diff in the pull request: https://github.com/apache/carbondata/pull/1469#discussion_r153095958 --- Diff: integration/spark2/src/test/scala/org/apache/spark/carbondata/restructure/AlterTableValidationTestCase.scala --- @@ -85,71 +85,75 @@ class AlterTableValidationTestCase extends Spark2QueryTest with BeforeAndAfterAl "('DICTIONARY_EXCLUDE'='nodict', 'DEFAULT.VALUE.NoDict'= 'abcd')") checkAnswer(sql("select distinct(nodict) from restructure"), Row("abcd")) } - test("test add timestamp no dictionary column") { - sql( - "alter table restructure add columns(tmpstmp timestamp) TBLPROPERTIES ('DEFAULT.VALUE" + - ".tmpstmp'= '17-01-2007')") - checkAnswer(sql("select distinct(tmpstmp) from restructure"), - Row(new java.sql.Timestamp(107, 0, 17, 0, 0, 0, 0))) - checkExistence(sql("desc restructure"), true, "tmpstmptimestamp") - } - - test("test add timestamp direct dictionary column") { - sql( - "alter table restructure add columns(tmpstmp1 timestamp) TBLPROPERTIES ('DEFAULT.VALUE" + - ".tmpstmp1'= '17-01-3007','DICTIONARY_INCLUDE'='tmpstmp1')") - checkAnswer(sql("select distinct(tmpstmp1) from restructure"), - Row(null)) - checkExistence(sql("desc restructure"), true, "tmpstmptimestamp") - } - - test("test add timestamp column and load as dictionary") { - sql("create table table1(name string) stored by 'carbondata'") - sql("insert into table1 select 'abc'") - sql("alter table table1 add columns(tmpstmp timestamp) TBLPROPERTIES " + - "('DEFAULT.VALUE.tmpstmp'='17-01-3007','DICTIONARY_INCLUDE'= 'tmpstmp')") - sql("insert into table1 select 'name','17-01-2007'") - checkAnswer(sql("select * from table1"), - Seq(Row("abc",null), - Row("name",Timestamp.valueOf("2007-01-17 00:00:00.0")))) - } - - test("test add msr column") { - sql( - "alter table restructure add columns(msrField decimal(5,2))TBLPROPERTIES ('DEFAULT.VALUE" + - ".msrfield'= '123.45')") - checkExistence(sql("desc restructure"), true, "msrfielddecimal(5,2)") - val output = sql("select msrField from restructure").collect - checkAnswer(sql("select distinct(msrField) from restructure"), - Row(new BigDecimal("123.45").setScale(2, RoundingMode.HALF_UP))) - } - - test("test add all datatype supported dictionary column") { - sql( - "alter table restructure add columns(strfld string, datefld date, tptfld timestamp, " + - "shortFld smallInt, " + - "intFld int, longFld bigint, dblFld double,dcml decimal(5,4))TBLPROPERTIES" + - "('DICTIONARY_INCLUDE'='datefld,shortFld,intFld,longFld,dblFld,dcml', 'DEFAULT.VALUE" + - ".dblFld'= '12345')") - checkAnswer(sql("select distinct(dblFld) from restructure"), - Row(java.lang.Double.parseDouble("12345"))) - checkExistence(sql("desc restructure"), true, "strfldstring") - checkExistence(sql("desc restructure"), true, "dateflddate") - checkExistence(sql("desc restructure"), true, "tptfldtimestamp") - checkExistence(sql("desc restructure"), true, "shortfldsmallint") - checkExistence(sql("desc restructure"), true, "intfldint") - checkExistence(sql("desc restructure"), true, "longfldbigint") - checkExistence(sql("desc restructure"), true, "dblflddouble") - checkExistence(sql("desc restructure"), true, "dcmldecimal(5,4)") - } - - test( - "test add decimal without scale and precision, default precision and scale (10,0) should be " + - "used") - { - sql("alter table restructure add columns(dcmldefault decimal)") - checkExistence(sql("desc restructure"), true, "dcmldefaultdecimal(10,0)") - } +// test("test add timestamp no dictionary column") { --- End diff -- Ok
---