[feature-wip](unique-key-merge-on-write) support alter table column for MoW (#12052)

This commit is contained in:
zhannngchen
2022-08-26 09:40:11 +08:00
committed by GitHub
parent 8deead66cd
commit e5bfbbe761
2 changed files with 13 additions and 5 deletions

View File

@ -1998,7 +1998,7 @@ Status Tablet::calc_delete_bitmap(RowsetId rowset_id,
CHECK(st.ok() || st.is_not_found() || st.is_already_exist());
if (st.is_not_found()) continue;
// sequece id smaller than the previous one, so delelte current row
// sequence id smaller than the previous one, so delete current row
if (st.is_already_exist()) {
loc.rowset_id = rowset_id;
loc.segment_id = seg->id();
@ -2081,8 +2081,8 @@ Status Tablet::update_delete_bitmap(const RowsetSharedPtr& rowset, DeleteBitmapP
}
// update version without write lock, compaction and publish_txn
// will update delete bitmap, handle compaction with _delete_bitmap_lock
// and publish_txn runs sequencial so no need to lock here
// will update delete bitmap, handle compaction with _rowset_update_lock
// and publish_txn runs sequential so no need to lock here
for (auto iter = delete_bitmap->delete_bitmap.begin();
iter != delete_bitmap->delete_bitmap.end(); ++iter) {
int ret = _tablet_meta->delete_bitmap().set(

View File

@ -499,7 +499,11 @@ public class SchemaChangeHandler extends AlterHandler {
+ modColumn.getName());
}
if (!modColumn.isKey()) {
modColumn.setAggregationType(AggregateType.REPLACE, true);
if (olapTable.getEnableUniqueKeyMergeOnWrite()) {
modColumn.setAggregationType(AggregateType.NONE, false);
} else {
modColumn.setAggregationType(AggregateType.REPLACE, true);
}
}
} else {
if (null != modColumn.getAggregationType()) {
@ -860,7 +864,11 @@ public class SchemaChangeHandler extends AlterHandler {
"Can not assign aggregation method" + " on column in Unique data model table: " + newColName);
}
if (!newColumn.isKey()) {
newColumn.setAggregationType(AggregateType.REPLACE, true);
if (olapTable.getEnableUniqueKeyMergeOnWrite()) {
newColumn.setAggregationType(AggregateType.NONE, false);
} else {
newColumn.setAggregationType(AggregateType.REPLACE, true);
}
}
} else {
if (newColumn.getAggregationType() != null) {