Skip to content

Commit

Permalink
[HUDI-4706] Fix InternalSchemaChangeApplier#applyAddChange error to a…
Browse files Browse the repository at this point in the history
…dd nest type
  • Loading branch information
wangzixuan.wzxuan committed Aug 26, 2022
1 parent 11f85d1 commit 9d687af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -51,7 +51,8 @@ public InternalSchema applyAddChange(
TableChange.ColumnPositionChange.ColumnPositionType positionType) {
TableChanges.ColumnAddChange add = TableChanges.ColumnAddChange.get(latestSchema);
String parentName = TableChangesHelper.getParentName(colName);
add.addColumns(parentName, colName, colType, doc);
String leafName = TableChangesHelper.getLeafName(colName);
add.addColumns(parentName, leafName, colType, doc);
if (positionType != null) {
switch (positionType) {
case NO_OPERATION:
Expand Down
Expand Up @@ -76,4 +76,9 @@ public static String getParentName(String fullColName) {
int offset = fullColName.lastIndexOf(".");
return offset > 0 ? fullColName.substring(0, offset) : "";
}

public static String getLeafName(String fullColName) {
int offset = fullColName.lastIndexOf(".");
return offset > 0 ? fullColName.substring(offset + 1) : fullColName;
}
}

0 comments on commit 9d687af

Please sign in to comment.