Skip to content

Commit

Permalink
fix unique_id error (apache#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lchangliang committed Jun 29, 2022
1 parent 733cb37 commit 4c3ad30
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion be/src/olap/tablet_meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,12 @@ TabletMeta::TabletMeta(int64_t table_id, int64_t partition_id, int64_t tablet_id
bool has_bf_columns = false;
for (TColumn tcolumn : tablet_schema.columns) {
ColumnPB* column = schema->add_column();
uint32_t unique_id = col_ordinal_to_unique_id.at(col_ordinal++);
uint32_t unique_id = -1;
if (tcolumn.col_unique_id >= 0) {
unique_id = tcolumn.col_unique_id;
} else {
unique_id = col_ordinal_to_unique_id.at(col_ordinal++);
}
init_column_from_tcolumn(unique_id, tcolumn, column);

if (column->is_key()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ private void processModifyColumn(ModifyColumnClause alterClause, OlapTable olapT
Column oriColumn = schemaForFinding.get(modColIndex);
// retain old column name
modColumn.setName(oriColumn.getName());
modColumn.setUniqueId(oriColumn.getUniqueId());

// handle the move operation in 'indexForFindingColumn' if has
if (hasColPos) {
Expand Down

0 comments on commit 4c3ad30

Please sign in to comment.