Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[CARBONDATA-4179] Support renaming of complex columns (array/struct)
Why is this PR needed? This PR enables renaming of complex columns - parent as well as children columns with nested levels example: if the schema contains columns - str1 struct<a:int, b:string>, arr1 array<long> 1. alter table <table_name> change str1 str2 struct<a:int, b:string> 2. alter table <table_name> change arr1 arr2 array<long> 3. Changing parent name as well as child name 4. alter table <table_name> change str1 str2 struct<abc:int, b:string> NOTE- Rename operation fails if the structure of the complex column has been altered. This check ensures the old and new columns are compatible with each other. Meaning the number of children and complex levels should be unaltered while attempting to rename. What changes were proposed in this PR? 1. Parses the incoming new complex type. Create a nested DatatypeInfo structure. 2. This DatatypeInfo is then passed on to the AlterTableDataTypeChangeModel. 3. Validation for compatibility, duplicate columns happens here. 4. Add the parent column to the schema evolution entry. 5. Update the spark catalog table. Limitation - Renaming is not supported for Map types yet Does this PR introduce any user interface change? Yes Is any new testcase added? Yes This closes #4129
- Loading branch information
1 parent
d838e3b
commit cfa02dd3db2906750aeef2ebc657a1c4f58b2d66
Showing
12 changed files
with
693 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.