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

Function getFirstArrayJoin

src/Parsers/ASTSelectQuery.cpp:322–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320}
321
322static const ASTArrayJoin * getFirstArrayJoin(const ASTSelectQuery & select)
323{
324 if (!select.tables())
325 return {};
326
327 const auto & tables_in_select_query = select.tables()->as<ASTTablesInSelectQuery &>();
328 if (tables_in_select_query.children.empty())
329 return {};
330
331 const ASTArrayJoin * array_join = nullptr;
332 for (const auto & child : tables_in_select_query.children)
333 {
334 const auto & tables_element = child->as<ASTTablesInSelectQueryElement &>();
335 if (tables_element.array_join)
336 {
337 if (!array_join)
338 array_join = tables_element.array_join->as<ASTArrayJoin>();
339 else
340 throw Exception("Support for more than one ARRAY JOIN in query is not implemented", ErrorCodes::NOT_IMPLEMENTED);
341 }
342 }
343
344 return array_join;
345}
346
347static const ASTTablesInSelectQueryElement * getFirstTableJoin(const ASTSelectQuery & select)
348{

Callers 1

Calls 3

ExceptionClass · 0.50
tablesMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected