Skip to content

Commit 7b0f970

Browse files
Emgarikoaavdonkin
andauthored
Set field Engine to 1 to maintain backward compatibility (#17567)
Co-authored-by: Alexander Avdonkin <aavdonkin@yandex.ru>
1 parent 92bb59e commit 7b0f970

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

ydb/core/protos/flat_scheme_op.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ message TColumnTableSchema {
547547
repeated TOlapColumnDescription Columns = 1;
548548
repeated string KeyColumnNames = 2;
549549

550+
optional EColumnTableEngine Engine = 3;
550551
// Internal fields
551552
optional uint32 NextColumnId = 4;
552553

ydb/core/tx/columnshard/tables_manager.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ void TTablesManager::AddSchemaVersion(
276276
it->second = schema;
277277
}
278278

279+
versionInfo.MutableSchema()->SetEngine(NKikimrSchemeOp::COLUMN_ENGINE_REPLACING_TIMESERIES);
279280
Schema::SaveSchemaPresetVersionInfo(db, presetId, version, versionInfo);
280281
if (!PrimaryIndex) {
281282
PrimaryIndex = std::make_unique<NOlap::TColumnEngineForLogs>(TabletId, SchemaObjectsCache, DataAccessorsManager, StoragesManager,

ydb/core/tx/schemeshard/schemeshard_impl.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3648,8 +3648,12 @@ void TSchemeShard::PersistColumnTable(NIceDb::TNiceDb& db, TPathId pathId, const
36483648

36493649
TString serialized;
36503650
TString serializedSharding;
3651-
Y_ABORT_UNLESS(tableInfo.Description.SerializeToString(&serialized));
3652-
Y_ABORT_UNLESS(tableInfo.Description.GetSharding().SerializeToString(&serializedSharding));
3651+
auto tableInfoCopy = tableInfo;
3652+
if (tableInfo.IsStandalone()) {
3653+
tableInfoCopy.Description.MutableSchema()->SetEngine(NKikimrSchemeOp::COLUMN_ENGINE_REPLACING_TIMESERIES);
3654+
}
3655+
Y_ABORT_UNLESS(tableInfoCopy.Description.SerializeToString(&serialized));
3656+
Y_ABORT_UNLESS(tableInfoCopy.Description.GetSharding().SerializeToString(&serializedSharding));
36533657

36543658
if (isAlter) {
36553659
db.Table<Schema::ColumnTablesAlters>().Key(pathId.LocalPathId).Update(

0 commit comments

Comments
 (0)