Skip to content

Commit

Permalink
[Improve](Schema Change) avoid printing stack trace when check __DORI…
Browse files Browse the repository at this point in the history
…S_ROW_STORE_COL__

This may result misunderstanding
  • Loading branch information
eldenmoon committed Aug 1, 2024
1 parent 004c5a3 commit b400f7e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions be/src/olap/schema_change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1317,8 +1317,8 @@ Status SchemaChangeJob::parse_request(const SchemaChangeParams& sc_params,
}

// if new tablet enable row store, or new tablet has different row store columns
if ((!base_tablet_schema->have_column(BeConsts::ROW_STORE_COL) &&
new_tablet_schema->have_column(BeConsts::ROW_STORE_COL)) ||
if ((!base_tablet_schema->exist_column(BeConsts::ROW_STORE_COL) &&
new_tablet_schema->exist_column(BeConsts::ROW_STORE_COL)) ||
!std::equal(new_tablet_schema->row_columns_uids().begin(),
new_tablet_schema->row_columns_uids().end(),
base_tablet_schema->row_columns_uids().begin(),
Expand Down
4 changes: 4 additions & 0 deletions be/src/olap/tablet_schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,10 @@ void TabletSchema::update_indexes_from_thrift(const std::vector<doris::TOlapTabl
_indexes = std::move(indexes);
}

bool TabletSchema::exist_column(const std::string& field_name) const {
return _field_name_to_index.contains(StringRef {field_name});
}

Status TabletSchema::have_column(const std::string& field_name) const {
if (!_field_name_to_index.contains(StringRef(field_name))) {
return Status::Error<ErrorCode::INTERNAL_ERROR>(
Expand Down
1 change: 1 addition & 0 deletions be/src/olap/tablet_schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ class TabletSchema {
const TabletColumn& column(size_t ordinal) const;
Result<const TabletColumn*> column(const std::string& field_name) const;
Status have_column(const std::string& field_name) const;
bool exist_column(const std::string& field_name) const;
const TabletColumn& column_by_uid(int32_t col_unique_id) const;
TabletColumn& mutable_column_by_uid(int32_t col_unique_id);
TabletColumn& mutable_column(size_t ordinal);
Expand Down

0 comments on commit b400f7e

Please sign in to comment.