Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions be/src/olap/rowset/segment_v2/column_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ Status ColumnReader::create_map(const ColumnReaderOptions& opts, const ColumnMet
const io::FileReaderSPtr& file_reader,
std::unique_ptr<ColumnReader>* reader) {
// map reader now has 3 sub readers for key, value, offsets(scalar), null(scala)
DCHECK(meta.children_columns_size() == 3 || meta.children_columns_size() == 4);
std::unique_ptr<ColumnReader> key_reader;
RETURN_IF_ERROR(ColumnReader::create(opts, meta.children_columns(0),
meta.children_columns(0).num_rows(), file_reader,
Expand Down
7 changes: 6 additions & 1 deletion be/src/olap/rowset/segment_v2/column_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ Status ColumnWriter::create_map_writer(const ColumnWriterOptions& opts, const Ta
io::FileWriter* file_writer,
std::unique_ptr<ColumnWriter>* writer) {
DCHECK(column->get_subtype_count() == 2);
if (column->get_subtype_count() < 2) {
return Status::InternalError(
"If you upgraded from version 1.2.*, please DROP the MAP columns and then "
"ADD the MAP columns back.");
}
// create key & value writer
std::vector<std::unique_ptr<ColumnWriter>> inner_writer_list;
for (int i = 0; i < 2; ++i) {
Expand Down Expand Up @@ -1141,4 +1146,4 @@ Status MapColumnWriter::write_inverted_index() {
return Status::OK();
}

} // namespace doris::segment_v2
} // namespace doris::segment_v2
6 changes: 4 additions & 2 deletions be/src/olap/tablet_schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,8 @@ void TabletColumn::init_from_pb(const ColumnPB& column) {
CHECK(column.children_columns_size() == 1) << "ARRAY type has more than 1 children types.";
}
if (_type == FieldType::OLAP_FIELD_TYPE_MAP) {
CHECK(column.children_columns_size() == 2) << "MAP type has more than 2 children types.";
DCHECK(column.children_columns_size() == 2) << "MAP type has more than 2 children types.";
LOG(WARNING) << "MAP type has more than 2 children types.";
}
for (size_t i = 0; i < column.children_columns_size(); i++) {
TabletColumn child_column;
Expand Down Expand Up @@ -623,7 +624,8 @@ void TabletColumn::to_schema_pb(ColumnPB* column) const {
CHECK(_sub_columns.size() == 1) << "ARRAY type has more than 1 children types.";
}
if (_type == FieldType::OLAP_FIELD_TYPE_MAP) {
CHECK(_sub_columns.size() == 2) << "MAP type has more than 2 children types.";
DCHECK(_sub_columns.size() == 2) << "MAP type has more than 2 children types.";
LOG(WARNING) << "MAP type has more than 2 children types.";
}

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