Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CARBONDATA-3628] Support alter hive table add complex column type #3529

Closed

Conversation

IceMimosa
Copy link
Contributor

Tips:

  • Complex type only supports default, see DataTypeUtil#valueOf
  • Fix compile error

Be sure to do all of the following checklists to help us incorporate
your contribution quickly and easily:

  • 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 the 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.

@CarbonDataQA1
Copy link

Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/1279/

@CarbonDataQA1
Copy link

Build Success with Spark 2.2.1, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.2/1268/

@CarbonDataQA1
Copy link

Build Success with Spark 2.1.0, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.1/1258/

@CarbonDataQA1
Copy link

Build Success with Spark 2.1.0, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.1/1261/

@CarbonDataQA1
Copy link

Build Success with Spark 2.2.1, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.2/1271/

@CarbonDataQA1
Copy link

Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/1282/

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>)")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a case with STRUCT Datatype also

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not work with default STRUCT Datatype (struct<>)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why it doesn't work with Struct type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataTypeUtil.valueOf just return default struct type (struct<>), here should work more for this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this PR is just to support map, please modify the PR title and description.
To support struct type, need another PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this PR only support map<string, string>, array<string>, struct<> currently. I can do some work to fully support this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will merge this PR. Please raise another JIRA ticket for the struct support. Thanks

@CarbonDataQA1
Copy link

Build Success with Spark 2.1.0, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.1/1273/

@CarbonDataQA1
Copy link

Build Success with Spark 2.2.1, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.2/1283/

@CarbonDataQA1
Copy link

Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12545/job/ApacheCarbonPRBuilder2.3/1294/

@jackylk
Copy link
Contributor

jackylk commented Dec 29, 2019

LGTM

@asfgit asfgit closed this in bd54ce8 Dec 29, 2019
marchpure pushed a commit to marchpure/carbondata that referenced this pull request Dec 30, 2019
Support adding array and map data type column by ALTER TABLE

This closes apache#3529
niuge01 pushed a commit to niuge01/carbondata that referenced this pull request Dec 30, 2019
Support adding array and map data type column by ALTER TABLE

This closes apache#3529
MarvinLitt pushed a commit to MarvinLitt/carbondata that referenced this pull request Jan 3, 2020
Support adding array and map data type column by ALTER TABLE

This closes apache#3529
@IceMimosa IceMimosa deleted the feature/fix-CARBONDATA-3628 branch January 8, 2020 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants