diff options
author | monster <[email protected]> | 2023-08-21 18:09:47 +0300 |
---|---|---|
committer | monster <[email protected]> | 2023-08-21 18:30:11 +0300 |
commit | 2a0711baa015550f8b6709cfd47148baf8f167ff (patch) | |
tree | 0da3dccb447673ff72e742ac625ef3242ff33176 | |
parent | 6a0b4a255c58b2b5f8e5b999200c090d9120b227 (diff) |
support column tables in statistics KIKIMR-18323
-rw-r--r-- | ydb/core/tx/schemeshard/schemeshard_impl.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/ydb/core/tx/schemeshard/schemeshard_impl.cpp b/ydb/core/tx/schemeshard/schemeshard_impl.cpp index dd3c193779c..65316279987 100644 --- a/ydb/core/tx/schemeshard/schemeshard_impl.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_impl.cpp @@ -6753,20 +6753,33 @@ void TSchemeShard::Handle(NStat::TEvStatistics::TEvGetStatisticsFromSS::TPtr& ev for (const auto& pathIdIn : recordIn.GetPathIds()) { TPathId pathId(pathIdIn.GetOwnerId(), pathIdIn.GetLocalId()); - auto pathFound = Tables.find(pathId); auto& entryOut = *recordOut.AddEntries(); entryOut.MutablePathId()->CopyFrom(pathIdIn); - if (pathFound == Tables.end()) { - entryOut.SetSuccess(false); - entryOut.SetRowCount(0); - entryOut.SetBytesSize(0); - } else { - const auto& aggregated = pathFound->second->GetStats().Aggregated; + + auto itTable = Tables.find(pathId); + if (itTable != Tables.end()) { + const auto& aggregated = itTable->second->GetStats().Aggregated; entryOut.SetSuccess(true); entryOut.SetRowCount(aggregated.RowCount); entryOut.SetBytesSize(aggregated.DataSize); + continue; + } + + if (ColumnTables.contains(pathId)) { + auto columnTableInfo = ColumnTables.GetVerified(pathId); + if (columnTableInfo->IsStandalone()) { + const auto& aggregated = columnTableInfo->GetStats().Aggregated; + entryOut.SetSuccess(true); + entryOut.SetRowCount(aggregated.RowCount); + entryOut.SetBytesSize(aggregated.DataSize); + continue; + } } + + entryOut.SetSuccess(false); + entryOut.SetRowCount(0); + entryOut.SetBytesSize(0); } ctx.Send(ev->Sender, result.Release(), 0, ev->Cookie); |