You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by 397090770 <gi...@git.apache.org> on 2017/10/30 06:16:52 UTC
[GitHub] carbondata pull request #1452: [CARBONDATA-1593] Add partition to table caus...
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 <wy...@163.com>
Date: 2017-10-30T04:49:53Z
[CARBONDATA-1593] Add partition to table cause NoSuchTableException
----
---
[GitHub] carbondata issue #1452: [CARBONDATA-1593] Add partition to table cause NoSuc...
Posted by CarbonDataQA <gi...@git.apache.org>.
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/
---
[GitHub] carbondata pull request #1452: [CARBONDATA-1593] Add partition to table caus...
Posted by 397090770 <gi...@git.apache.org>.
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.
---
[GitHub] carbondata issue #1452: [CARBONDATA-1593] Add partition to table cause NoSuc...
Posted by 397090770 <gi...@git.apache.org>.
Github user 397090770 commented on the issue:
https://github.com/apache/carbondata/pull/1452
@CarbonDataQA retest this please
---
[GitHub] carbondata pull request #1452: [CARBONDATA-1593] Add partition to table caus...
Posted by sounakr <gi...@git.apache.org>.
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.
---
[GitHub] carbondata issue #1452: [CARBONDATA-1593] Add partition to table cause NoSuc...
Posted by 397090770 <gi...@git.apache.org>.
Github user 397090770 commented on the issue:
https://github.com/apache/carbondata/pull/1452
@sounakr , @lionelcao , @chenliang613 Please help review, Thank you.
---
[GitHub] carbondata issue #1452: [CARBONDATA-1593] Add partition to table cause NoSuc...
Posted by ravipesala <gi...@git.apache.org>.
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/
---
[GitHub] carbondata issue #1452: [CARBONDATA-1593] Add partition to table cause NoSuc...
Posted by CarbonDataQA <gi...@git.apache.org>.
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/
---
[GitHub] carbondata issue #1452: [CARBONDATA-1593] Add partition to table cause NoSuc...
Posted by ravipesala <gi...@git.apache.org>.
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/1405/
---
[GitHub] carbondata issue #1452: [CARBONDATA-1593] Add partition to table cause NoSuc...
Posted by 397090770 <gi...@git.apache.org>.
Github user 397090770 commented on the issue:
https://github.com/apache/carbondata/pull/1452
@sounakr Please help review the test case, Thank you.
---
[GitHub] carbondata issue #1452: [CARBONDATA-1593] Add partition to table cause NoSuc...
Posted by sounakr <gi...@git.apache.org>.
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.
---
[GitHub] carbondata issue #1452: [CARBONDATA-1593] Add partition to table cause NoSuc...
Posted by sounakr <gi...@git.apache.org>.
Github user sounakr commented on the issue:
https://github.com/apache/carbondata/pull/1452
@397090770 Please squash multiple commits into a single one.
---
[GitHub] carbondata pull request #1452: [CARBONDATA-1593] Add partition to table caus...
Posted by sounakr <gi...@git.apache.org>.
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.
---
[GitHub] carbondata pull request #1452: [CARBONDATA-1593] Add partition to table caus...
Posted by lionelcao <gi...@git.apache.org>.
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
---
[GitHub] carbondata issue #1452: [CARBONDATA-1593] Add partition to table cause NoSuc...
Posted by lionelcao <gi...@git.apache.org>.
Github user lionelcao commented on the issue:
https://github.com/apache/carbondata/pull/1452
LGTM
---
[GitHub] carbondata issue #1452: [CARBONDATA-1593] Add partition to table cause NoSuc...
Posted by ravipesala <gi...@git.apache.org>.
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/
---
[GitHub] carbondata issue #1452: [CARBONDATA-1593] Add partition to table cause NoSuc...
Posted by CarbonDataQA <gi...@git.apache.org>.
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/
---
[GitHub] carbondata issue #1452: [CARBONDATA-1593] Add partition to table cause NoSuc...
Posted by CarbonDataQA <gi...@git.apache.org>.
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/
---
[GitHub] carbondata issue #1452: [CARBONDATA-1593] Add partition to table cause NoSuc...
Posted by CarbonDataQA <gi...@git.apache.org>.
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/
---
[GitHub] carbondata issue #1452: [CARBONDATA-1593] Add partition to table cause NoSuc...
Posted by ravipesala <gi...@git.apache.org>.
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/
---
[GitHub] carbondata pull request #1452: [CARBONDATA-1593] Add partition to table caus...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/carbondata/pull/1452
---
[GitHub] carbondata issue #1452: [CARBONDATA-1593] Add partition to table cause NoSuc...
Posted by ravipesala <gi...@git.apache.org>.
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/1408/
---
[GitHub] carbondata pull request #1452: [CARBONDATA-1593] Add partition to table caus...
Posted by lionelcao <gi...@git.apache.org>.
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.
---
[GitHub] carbondata pull request #1452: [CARBONDATA-1593] Add partition to table caus...
Posted by 397090770 <gi...@git.apache.org>.
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.
---
[GitHub] carbondata issue #1452: [CARBONDATA-1593] Add partition to table cause NoSuc...
Posted by sounakr <gi...@git.apache.org>.
Github user sounakr commented on the issue:
https://github.com/apache/carbondata/pull/1452
LGTM
---