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

Function getFirstTableExpression

src/Parsers/ASTSelectQuery.cpp:290–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288
289
290static const ASTTableExpression * getFirstTableExpression(const ASTSelectQuery & select)
291{
292 if (!select.tables())
293 return {};
294
295 const auto & tables_in_select_query = select.tables()->as<ASTTablesInSelectQuery &>();
296 if (tables_in_select_query.children.empty())
297 return {};
298
299 const auto & tables_element = tables_in_select_query.children[0]->as<ASTTablesInSelectQueryElement &>();
300 if (!tables_element.table_expression)
301 return {};
302
303 return tables_element.table_expression->as<ASTTableExpression>();
304}
305
306static ASTTableExpression * getFirstTableExpression(ASTSelectQuery & select)
307{

Callers 5

sampleSizeMethod · 0.70
sampleOffsetMethod · 0.70
finalMethod · 0.70
addTableFunctionMethod · 0.70

Calls 2

tablesMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected