Github user sounakr commented on a diff in the pull request: https://github.com/apache/carbondata/pull/1452#discussion_r147941827 --- Diff: integration/spark2/src/test/scala/org/apache/carbondata/spark/testsuite/partition/TestAlterPartitionTable.scala --- @@ -779,6 +779,25 @@ class TestAlterPartitionTable extends QueryTest with BeforeAndAfterAll { .contains("Data in range info must be the same type with the partition field's type")) } + test("Add partition to table in or not in default database") { + sql("DROP TABLE IF EXISTS carbon_table_default_db") + sql( + """ + | CREATE TABLE carbon_table_default_db(id INT, name STRING) PARTITIONED BY (dt STRING) + | STORED BY 'carbondata' TBLPROPERTIES('PARTITION_TYPE'='RANGE', 'RANGE_INFO'='2015,2016') + """.stripMargin) + sql("ALTER TABLE carbon_table_default_db ADD PARTITION ('2017')") + + sql("CREATE DATABASE IF NOT EXISTS carbondb") + sql("DROP TABLE IF EXISTS carbondb.carbontable") + sql( + """ + | CREATE TABLE carbondb.carbontable(id INT, name STRING) PARTITIONED BY (dt STRING) + | STORED BY 'carbondata' TBLPROPERTIES('PARTITION_TYPE'='RANGE', 'RANGE_INFO'='2015,2016') + """.stripMargin) --- End diff -- Also these test cases should have auto validation check present i.e. what is the expected output of Alter statement. Probably through the help of assert.
---