Github user lionelcao commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1192#discussion_r131063552
--- Diff:
examples/spark2/src/main/scala/org/apache/carbondata/examples/CarbonPartitionExample.scala
---
@@ -101,17 +126,40 @@ object CarbonPartitionExample {
spark.sql("""
| CREATE TABLE IF NOT EXISTS t5
| (
+ | id Int,
| vin String,
| logdate Timestamp,
| phonenumber Long,
- | area String
+ | area String,
+ | salary Int
|)
| PARTITIONED BY (country String)
| STORED BY 'carbondata'
| TBLPROPERTIES('PARTITION_TYPE'='LIST',
- | 'LIST_INFO'='(China,United States),UK ,japan,(Canada,Russia),
South Korea ')
+ | 'LIST_INFO'='(China, US),UK ,Japan,(Canada,Russia, Good,
NotGood), Korea ')
""".stripMargin)
+ // load data into partition table
+ spark.sql(s"""
+ LOAD DATA LOCAL INPATH '$testData' into table t0
options('BAD_RECORDS_ACTION'='FORCE')
+ """)
+ spark.sql(s"""
+ LOAD DATA LOCAL INPATH '$testData' into table t5
options('BAD_RECORDS_ACTION'='FORCE')
+ """)
+
+ // alter list partition table t5 to add a partition
+ spark.sql(s"""Alter table t5 add partition ('OutSpace')""".stripMargin)
+ // alter list partition table t5 to split partition 4 into 3
independent partition
+ spark.sql(
+ s"""
+ Alter table t5 split partition(4) into ('Canada', 'Russia',
'(Good, NotGood)')
+ """.stripMargin)
--- End diff --
yes, I have written the test case to verify it. Please refer to
TestAlterPartitionTable.scala
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---