Skip to content

Commit

Permalink
fix compability
Browse files Browse the repository at this point in the history
  • Loading branch information
eldenmoon committed Oct 10, 2024
1 parent 72c9873 commit 5380920
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions fe/fe-core/src/main/java/org/apache/doris/catalog/Column.java
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,13 @@ private void setChildrenTColumn(Column children, TColumn tColumn) {
toChildrenThrift(children, childrenTColumn);
}

private void addChildren(Column column, TColumn tColumn) {
List<Column> childrenColumns = column.getChildren();
for (Column c : childrenColumns) {
setChildrenTColumn(c, tColumn);
}
}

private void toChildrenThrift(Column column, TColumn tColumn) {
if (column.type.isArrayType()) {
Column children = column.getChildren().get(0);
Expand All @@ -676,13 +683,11 @@ private void toChildrenThrift(Column column, TColumn tColumn) {
tColumn.setChildrenColumn(new ArrayList<>());
setChildrenTColumn(k, tColumn);
setChildrenTColumn(v, tColumn);
} else if (column.type.isStructType()
|| (column.type.isVariantType() && !((VariantType) (column.type)).getPredefinedFields().isEmpty())) {
List<Column> childrenColumns = column.getChildren();
tColumn.setChildrenColumn(new ArrayList<>());
for (Column children : childrenColumns) {
setChildrenTColumn(children, tColumn);
}
} else if (column.type.isStructType()) {
addChildren(column, tColumn);
} else if (column.type.isVariantType()) {
// variant may contain predefined structured fields
addChildren(column, tColumn);
}
}

Expand Down

0 comments on commit 5380920

Please sign in to comment.