MCPcopy Create free account
hub / github.com/ByConity/ByConity / getTableStatistics

Function getTableStatistics

src/Statistics/VersionHelper.cpp:14–27  ·  view source on GitHub ↗

this can be nullable

Source from the content-addressed store, hash-verified

12{
13// this can be nullable
14std::shared_ptr<StatsTableBasic> getTableStatistics(ContextPtr context, const StatsTableIdentifier & table)
15{
16 auto catalog = createCatalogAdaptor(context);
17 auto policy = context->getSettingsRef().statistics_cache_policy;
18 auto proxy = createCachedStatsProxy(catalog, policy);
19 auto stats = proxy->get(table, true, {});
20 auto tag = StatisticsTag::TableBasic;
21 if (auto iter = stats.table_stats.find(tag); iter != stats.table_stats.end())
22 {
23 auto obj = std::dynamic_pointer_cast<StatsTableBasic>(iter->second);
24 return obj;
25 }
26 return nullptr;
27}
28
29std::optional<DateTime64> getVersion(ContextPtr context, const StatsTableIdentifier & table)
30{

Callers 2

getVersionFunction · 0.85
executeTableMethod · 0.85

Calls 5

createCatalogAdaptorFunction · 0.85
createCachedStatsProxyFunction · 0.85
getMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected