MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / readImpl

Method readImpl

src/Storages/StoragePrometheusQuery.cpp:169–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169void StoragePrometheusQuery::readImpl(
170 QueryPlan & query_plan,
171 const Names & column_names,
172 const StorageSnapshotPtr & /* storage_snapshot */,
173 SelectQueryInfo & query_info,
174 ContextPtr context,
175 QueryProcessingStage::Enum /* processed_stage */,
176 size_t /* max_block_size */,
177 size_t /* num_streams */)
178{
179 LOG_INFO(log, "Building SQL to evaluate promql: {}", *config.promql_query);
180 PrometheusQueryToSQL::Converter converter{config.promql_query, config.evaluation_settings};
181 ASTPtr select_query = converter.getSQL();
182
183 LOG_INFO(log, "Will execute query:\n{}", select_query->formatForLogging());
184 auto options = SelectQueryOptions(QueryProcessingStage::Complete, 0, false, query_info.settings_limit_offset_done);
185 InterpreterSelectQueryAnalyzer interpreter(select_query, context, options, column_names);
186 interpreter.addStorageLimits(*query_info.storage_limits);
187 query_plan = std::move(interpreter).extractQueryPlan();
188}
189
190}

Callers

nothing calls this directly

Calls 5

getSQLMethod · 0.80
formatForLoggingMethod · 0.80
extractQueryPlanMethod · 0.80
SelectQueryOptionsClass · 0.50
addStorageLimitsMethod · 0.45

Tested by

no test coverage detected