Skip to content

Commit

Permalink
[pick](upgrade) fix array map type check log message #38254 (#38704)
Browse files Browse the repository at this point in the history
  • Loading branch information
amorynan authored Aug 1, 2024
1 parent 90a2d71 commit 312c03a
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions be/src/olap/tablet_schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,11 +438,18 @@ void TabletColumn::init_from_pb(const ColumnPB& column) {
_visible = column.visible();
}
if (_type == FieldType::OLAP_FIELD_TYPE_ARRAY) {
CHECK(column.children_columns_size() == 1) << "ARRAY type has more than 1 children types.";
CHECK(column.children_columns_size() == 1)
<< "ARRAY type should has 1 children types, but got "
<< column.children_columns_size();
}
if (_type == FieldType::OLAP_FIELD_TYPE_MAP) {
DCHECK(column.children_columns_size() == 2) << "MAP type has more than 2 children types.";
LOG(WARNING) << "MAP type has more than 2 children types.";
DCHECK(column.children_columns_size() == 2)
<< "MAP type should has 2 children types, but got "
<< column.children_columns_size();
if (UNLIKELY(column.children_columns_size() != 2)) {
LOG(WARNING) << "MAP type should has 2 children types, but got "
<< column.children_columns_size();
}
}
for (size_t i = 0; i < column.children_columns_size(); i++) {
TabletColumn child_column;
Expand Down Expand Up @@ -479,11 +486,15 @@ void TabletColumn::to_schema_pb(ColumnPB* column) const {
column->set_visible(_visible);

if (_type == FieldType::OLAP_FIELD_TYPE_ARRAY) {
CHECK(_sub_columns.size() == 1) << "ARRAY type has more than 1 children types.";
CHECK(_sub_columns.size() == 1)
<< "ARRAY type should has 1 children types, but got " << _sub_columns.size();
}
if (_type == FieldType::OLAP_FIELD_TYPE_MAP) {
DCHECK(_sub_columns.size() == 2) << "MAP type has more than 2 children types.";
LOG(WARNING) << "MAP type has more than 2 children types.";
DCHECK(_sub_columns.size() == 2)
<< "MAP type should has 2 children types, but got " << _sub_columns.size();
if (UNLIKELY(_sub_columns.size() != 2)) {
LOG(WARNING) << "MAP type should has 2 children types, but got " << _sub_columns.size();
}
}

for (size_t i = 0; i < _sub_columns.size(); i++) {
Expand Down

0 comments on commit 312c03a

Please sign in to comment.