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

support basic stats for column tables #1014

Merged
Merged
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
13 changes: 12 additions & 1 deletion ydb/core/tx/schemeshard/schemeshard_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 8 additions & 0 deletions ydb/core/tx/schemeshard/schemeshard_tables_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,12 @@ bool TTablesStorage::TTableCreateOperator::InitShardingTablets(const TColumnTabl
return true;
}

std::unordered_set<TPathId> TTablesStorage::GetAllPathIds() const {
std::unordered_set<TPathId> result;
for (const auto& [pathId, _] : Tables) {
result.emplace(pathId);
}
return result;
}

}
1 change: 1 addition & 0 deletions ydb/core/tx/schemeshard/schemeshard_tables_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ class TTablesStorage {
void OnRemoveObject(const TPathId& pathId, TColumnTableInfo::TPtr object);
TColumnTableInfo::TPtr ExtractPtr(const TPathId& id);
public:
std::unordered_set<TPathId> GetAllPathIds() const;

TColumnTablesLayout GetTablesLayout(const std::vector<ui64>& tabletIds) const;

Expand Down
Loading