| 167 | } |
| 168 | |
| 169 | void 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 | } |
nothing calls this directly
no test coverage detected