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

Method getSampleBlock

src/Interpreters/InterpreterSelectWithUnionQuery.cpp:275–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273InterpreterSelectWithUnionQuery::~InterpreterSelectWithUnionQuery() = default;
274
275Block 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
293void InterpreterSelectWithUnionQuery::buildQueryPlan(QueryPlan & query_plan)

Calls 7

queryToStringFunction · 0.85
SelectQueryOptionsClass · 0.70
findMethod · 0.45
endMethod · 0.45
analyzeMethod · 0.45
subqueryMethod · 0.45

Tested by

no test coverage detected