| 273 | InterpreterSelectWithUnionQuery::~InterpreterSelectWithUnionQuery() = default; |
| 274 | |
| 275 | Block InterpreterSelectWithUnionQuery::getSampleBlock(const ASTPtr & query_ptr_, ContextPtr context_, bool is_subquery) |
| 276 | { |
| 277 | auto & cache = context_->getSampleBlockCache(); |
| 278 | /// Using query string because query_ptr changes for every internal SELECT |
| 279 | auto key = queryToString(query_ptr_); |
| 280 | if (cache.find(key) != cache.end()) |
| 281 | { |
| 282 | return cache[key]; |
| 283 | } |
| 284 | |
| 285 | if (is_subquery) |
| 286 | return cache[key] |
| 287 | = InterpreterSelectWithUnionQuery(query_ptr_, context_, SelectQueryOptions().subquery().analyze()).getSampleBlock(); |
| 288 | else |
| 289 | return cache[key] = InterpreterSelectWithUnionQuery(query_ptr_, context_, SelectQueryOptions().analyze()).getSampleBlock(); |
| 290 | } |
| 291 | |
| 292 | |
| 293 | void InterpreterSelectWithUnionQuery::buildQueryPlan(QueryPlan & query_plan) |
no test coverage detected