this can be nullable
| 12 | { |
| 13 | // this can be nullable |
| 14 | std::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 | |
| 29 | std::optional<DateTime64> getVersion(ContextPtr context, const StatsTableIdentifier & table) |
| 30 | { |
no test coverage detected