Indhumathi27 commented on a change in pull request #3529: [CARBONDATA-3628]
Support alter hive table add complex column type
URL: https://github.com/apache/carbondata/pull/3529#discussion_r361248397
##########
File path:
integration/spark-common-cluster-test/src/test/scala/org/apache/carbondata/cluster/sdv/generated/AlterTableTestCase.scala
##########
@@ -1022,7 +1022,31 @@ class AlterTableTestCase extends QueryTest with
BeforeAndAfterAll {
assert(exception.getMessage.contains("Unsupported alter operation on
hive table"))
} else if (SparkUtil.isSparkVersionXandAbove("2.2")) {
sql("alter table alter_hive add columns(add string)")
- sql("insert into alter_hive select 'abc','banglore'")
+ sql("alter table alter_hive add columns (var map<string, string>)")
+ sql("insert into alter_hive select
'abc','banglore',map('age','10','birth','2020')")
+ checkAnswer(
+ sql("select * from alter_hive"),
+ Seq(Row("abc", "banglore", Map("age" -> "10", "birth" -> "2020")))
+ )
+ }
+ }
+
+ test("Alter table add column for hive partitioned table for spark version
above 2.1") {
+ sql("drop table if exists alter_hive")
+ sql("create table alter_hive(name string) stored as rcfile partitioned by
(dt string)")
+ if (SparkUtil.isSparkVersionXandAbove("2.2")) {
+ sql("alter table alter_hive add columns(add string)")
+ sql("alter table alter_hive add columns (var map<string, string>)")
Review comment:
Can you please add a case with STRUCT Datatype also
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services