GitHub user 397090770 opened a pull request:
https://github.com/apache/carbondata/pull/1452 [CARBONDATA-1593] Add partition to table cause NoSuchTableException `AlterTableSplitCarbonPartition`'s `processSchema` method doesn't provide db info to `sparkSession.catalog.refreshTable`, this will cause `NoSuchTableException` when we add partitions to carbondata table. See [CARBONDATA-1593](https://issues.apache.org/jira/browse/CARBONDATA-1593) Be sure to do all of the following to help us incorporate your contribution quickly and easily: - [ ] Make sure the PR title is formatted like: `[CARBONDATA-<Jira issue #>] Description of pull request` - [ ] Make sure to add PR description including - the root cause/problem statement - What is the implemented solution - [ ] Any interfaces changed? - [ ] Any backward compatibility impacted? - [ ] Document update required? - [ ] Testing done Please provide details on - Whether new unit test cases have been added or why no new tests are required? - How it is tested? Please attach test report. - Is it a performance related change? Please attach the performance test report. - Any additional information to help reviewers in testing this change. - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA. --- You can merge this pull request into a Git repository by running: $ git pull https://github.com/397090770/carbondata CARBONDATA-1593 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/carbondata/pull/1452.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1452 ---- commit 0755773f4a407b25d63ce5e5c508b99e1c914c51 Author: wyp <[hidden email]> Date: 2017-10-30T04:49:53Z [CARBONDATA-1593] Add partition to table cause NoSuchTableException ---- --- |
Github user 397090770 commented on the issue:
https://github.com/apache/carbondata/pull/1452 @sounakr , @lionelcao , @chenliang613 Please help review, Thank you. --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1452 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/737/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/1452 SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/1374/ --- |
In reply to this post by qiuchenjian-2
Github user 397090770 commented on the issue:
https://github.com/apache/carbondata/pull/1452 @CarbonDataQA retest this please --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1452 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/738/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/1452 SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/1375/ --- |
In reply to this post by qiuchenjian-2
Github user sounakr commented on the issue:
https://github.com/apache/carbondata/pull/1452 @397090770 can you please add the test case base on this code change. --- |
In reply to this post by qiuchenjian-2
Github user 397090770 commented on the issue:
https://github.com/apache/carbondata/pull/1452 @sounakr Please help review the test case, Thank you. --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1452 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/761/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/1452 SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/1398/ --- |
In reply to this post by qiuchenjian-2
Github user lionelcao commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1452#discussion_r147917357 --- Diff: integration/spark2/src/test/scala/org/apache/carbondata/spark/testsuite/partition/TestAlterPartitionTable.scala --- @@ -779,6 +779,23 @@ class TestAlterPartitionTable extends QueryTest with BeforeAndAfterAll { .contains("Data in range info must be the same type with the partition field's type")) } + test("Alter table in or not in default database") { + sql("DROP TABLE IF EXISTS carbonTable_default_db") + sql(""" + | create table carbonTable_default_db(id int, name string) partitioned by (city string) + | row format delimited fields terminated by ',' + """.stripMargin) + sql("alter table carbonTable_default_db add partition (city = 'Beijing')") + + sql(s"CREATE DATABASE if not exists carbonDB") + sql("DROP TABLE IF EXISTS carbonDB.carbonTable") + sql(""" + | create table carbonDB.carbonTable(id int, name string) partitioned by (city string) + | row format delimited fields terminated by ',' --- End diff -- Same problem. --- |
In reply to this post by qiuchenjian-2
Github user lionelcao commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1452#discussion_r147917263 --- Diff: integration/spark2/src/test/scala/org/apache/carbondata/spark/testsuite/partition/TestAlterPartitionTable.scala --- @@ -779,6 +779,23 @@ class TestAlterPartitionTable extends QueryTest with BeforeAndAfterAll { .contains("Data in range info must be the same type with the partition field's type")) } + test("Alter table in or not in default database") { + sql("DROP TABLE IF EXISTS carbonTable_default_db") + sql(""" + | create table carbonTable_default_db(id int, name string) partitioned by (city string) + | row format delimited fields terminated by ',' --- End diff -- It's a hive table I think, please create the carbon table use stored by 'carbondata' and tblproperties --- |
In reply to this post by qiuchenjian-2
Github user 397090770 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1452#discussion_r147918498 --- Diff: integration/spark2/src/test/scala/org/apache/carbondata/spark/testsuite/partition/TestAlterPartitionTable.scala --- @@ -779,6 +779,23 @@ class TestAlterPartitionTable extends QueryTest with BeforeAndAfterAll { .contains("Data in range info must be the same type with the partition field's type")) } + test("Alter table in or not in default database") { + sql("DROP TABLE IF EXISTS carbonTable_default_db") + sql(""" + | create table carbonTable_default_db(id int, name string) partitioned by (city string) + | row format delimited fields terminated by ',' --- End diff -- @lionelcao Thank you for your review, I will fix this. --- |
In reply to this post by qiuchenjian-2
Github user sounakr commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1452#discussion_r147938347 --- 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')") --- End diff -- Both are positive test cases. Please add a negative test case, where the table doesn't exist in a perticular database but the table is present in current in-use database. For e.g. use default; create table table1; alter table carbondb.table1; This should fail. Rest looks good to me. --- |
In reply to this post by qiuchenjian-2
Github user sounakr commented on the issue:
https://github.com/apache/carbondata/pull/1452 @397090770 Please squash multiple commits into a single one. --- |
In reply to this post by qiuchenjian-2
Github user 397090770 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1452#discussion_r147940541 --- 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')") --- End diff -- Ok, I fix it. --- |
In reply to this post by qiuchenjian-2
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. --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1452 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/772/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1452 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/775/ --- |
Free forum by Nabble | Edit this page |