ClickHouse/src/Interpreters/RenameColumnVisitor.cpp
Raúl Marín 051dddd8df Reduce dependencies on ASTIdentifier.h
Goes from rebuilding 483 objects to 165 when it's modified
2021-11-26 16:49:40 +01:00

17 lines
482 B
C++

#include <Interpreters/IdentifierSemantic.h>
#include <Interpreters/RenameColumnVisitor.h>
#include <Parsers/ASTIdentifier.h>
namespace DB
{
void RenameColumnData::visit(ASTIdentifier & identifier, ASTPtr &) const
{
// TODO(ilezhankin): make proper rename
std::optional<String> identifier_column_name = IdentifierSemantic::getColumnName(identifier);
if (identifier_column_name && identifier_column_name == column_name)
identifier.setShortName(rename_to);
}
}