Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set field Engine to 1 to maintain backward compatibility (#15878) #15983

Open
wants to merge 1 commit into
base: stable-24-4-analytics
Choose a base branch
from
Open
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 ydb/core/protos/flat_scheme_op.proto
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ message TColumnTableSchema {
repeated TOlapColumnDescription Columns = 1;
repeated string KeyColumnNames = 2;

optional EColumnTableEngine Engine = 3;
// Internal fields
optional uint32 NextColumnId = 4;

Expand Down
1 change: 1 addition & 0 deletions ydb/core/tx/columnshard/tables_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ void TTablesManager::AddSchemaVersion(
it->second = schema;
}

versionInfo.MutableSchema()->SetEngine(NKikimrSchemeOp::COLUMN_ENGINE_REPLACING_TIMESERIES);
Schema::SaveSchemaPresetVersionInfo(db, presetId, version, versionInfo);
if (!PrimaryIndex) {
PrimaryIndex = std::make_unique<NOlap::TColumnEngineForLogs>(TabletId, SchemaObjectsCache, DataAccessorsManager, StoragesManager,
Expand Down
8 changes: 6 additions & 2 deletions ydb/core/tx/schemeshard/schemeshard_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3544,8 +3544,12 @@ void TSchemeShard::PersistColumnTable(NIceDb::TNiceDb& db, TPathId pathId, const

TString serialized;
TString serializedSharding;
Y_ABORT_UNLESS(tableInfo.Description.SerializeToString(&serialized));
Y_ABORT_UNLESS(tableInfo.Description.GetSharding().SerializeToString(&serializedSharding));
auto tableInfoCopy = tableInfo;
if (tableInfo.IsStandalone()) {
tableInfoCopy.Description.MutableSchema()->SetEngine(NKikimrSchemeOp::COLUMN_ENGINE_REPLACING_TIMESERIES);
}
Y_ABORT_UNLESS(tableInfoCopy.Description.SerializeToString(&serialized));
Y_ABORT_UNLESS(tableInfoCopy.Description.GetSharding().SerializeToString(&serializedSharding));

if (isAlter) {
db.Table<Schema::ColumnTablesAlters>().Key(pathId.LocalPathId).Update(
Expand Down
Loading