mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
made collectIdentifiersInFirstLevelOfSelectQuery static
This commit is contained in:
parent
5ed5e8c75d
commit
1cf669cc0a
@ -88,6 +88,24 @@ bool StorageMerge::hasColumn(const String & column_name) const
|
||||
return VirtualColumnFactory::hasColumn(column_name) || IStorage::hasColumn(column_name);
|
||||
}
|
||||
|
||||
static Names collectIdentifiersInFirstLevelOfSelectQuery(ASTPtr ast)
|
||||
{
|
||||
ASTSelectQuery & select = typeid_cast<ASTSelectQuery &>(*ast);
|
||||
ASTExpressionList & node = typeid_cast<ASTExpressionList &>(*select.select_expression_list);
|
||||
ASTs & asts = node.children;
|
||||
|
||||
Names names;
|
||||
for (size_t i = 0; i < asts.size(); ++i)
|
||||
{
|
||||
if (const ASTIdentifier * identifier = typeid_cast<const ASTIdentifier *>(&* asts[i]))
|
||||
{
|
||||
if (identifier->kind == ASTIdentifier::Kind::Column)
|
||||
names.push_back(identifier->name);
|
||||
}
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
BlockInputStreams StorageMerge::read(
|
||||
const Names & column_names,
|
||||
const ASTPtr & query,
|
||||
@ -305,22 +323,4 @@ void StorageMerge::alter(const AlterCommands & params, const String & database_n
|
||||
*columns, materialized_columns, alias_columns, column_defaults, {});
|
||||
}
|
||||
|
||||
Names StorageMerge::collectIdentifiersInFirstLevelOfSelectQuery(ASTPtr ast) const
|
||||
{
|
||||
ASTSelectQuery & select = typeid_cast<ASTSelectQuery &>(*ast);
|
||||
ASTExpressionList & node = typeid_cast<ASTExpressionList &>(*select.select_expression_list);
|
||||
ASTs & asts = node.children;
|
||||
|
||||
Names names;
|
||||
for (size_t i = 0; i < asts.size(); ++i)
|
||||
{
|
||||
if (const ASTIdentifier * identifier = typeid_cast<const ASTIdentifier *>(&* asts[i]))
|
||||
{
|
||||
if (identifier->kind == ASTIdentifier::Kind::Column)
|
||||
names.push_back(identifier->name);
|
||||
}
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -76,8 +76,6 @@ private:
|
||||
StorageListWithLocks getSelectedTables() const;
|
||||
|
||||
Block getBlockWithVirtualColumns(const StorageListWithLocks & selected_tables) const;
|
||||
|
||||
Names collectIdentifiersInFirstLevelOfSelectQuery(ASTPtr ast) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user