diff --git a/ydb/core/tx/schemeshard/schemeshard_impl.cpp b/ydb/core/tx/schemeshard/schemeshard_impl.cpp index 861d2ac453f1..55026ab3b282 100644 --- a/ydb/core/tx/schemeshard/schemeshard_impl.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_impl.cpp @@ -7052,7 +7052,18 @@ void TSchemeShard::SendBaseStatsToSA() { entry->SetBytesSize(aggregated.DataSize); ++count; } - // TODO: add column tables + auto columnTablesPathIds = ColumnTables.GetAllPathIds(); + for (const auto& pathId : columnTablesPathIds) { + const auto& tableInfo = ColumnTables.GetVerified(pathId); + const auto& aggregated = tableInfo->Stats.Aggregated; + auto* entry = record.AddEntries(); + auto* entryPathId = entry->MutablePathId(); + entryPathId->SetOwnerId(pathId.OwnerId); + entryPathId->SetLocalId(pathId.LocalPathId); + entry->SetRowCount(aggregated.RowCount); + entry->SetBytesSize(aggregated.DataSize); + ++count; + } TString stats; stats.clear(); diff --git a/ydb/core/tx/schemeshard/schemeshard_tables_storage.cpp b/ydb/core/tx/schemeshard/schemeshard_tables_storage.cpp index d8899d4dc208..63d3ed203226 100644 --- a/ydb/core/tx/schemeshard/schemeshard_tables_storage.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_tables_storage.cpp @@ -148,4 +148,12 @@ bool TTablesStorage::TTableCreateOperator::InitShardingTablets(const TColumnTabl return true; } +std::unordered_set TTablesStorage::GetAllPathIds() const { + std::unordered_set result; + for (const auto& [pathId, _] : Tables) { + result.emplace(pathId); + } + return result; +} + } diff --git a/ydb/core/tx/schemeshard/schemeshard_tables_storage.h b/ydb/core/tx/schemeshard/schemeshard_tables_storage.h index 26ce7daf42f3..036051295983 100644 --- a/ydb/core/tx/schemeshard/schemeshard_tables_storage.h +++ b/ydb/core/tx/schemeshard/schemeshard_tables_storage.h @@ -159,6 +159,7 @@ class TTablesStorage { void OnRemoveObject(const TPathId& pathId, TColumnTableInfo::TPtr object); TColumnTableInfo::TPtr ExtractPtr(const TPathId& id); public: + std::unordered_set GetAllPathIds() const; TColumnTablesLayout GetTablesLayout(const std::vector& tabletIds) const;