ClickHouse/src/Interpreters/RenameColumnVisitor.cpp

16 lines
447 B
C++
Raw Normal View History

#include <Interpreters/RenameColumnVisitor.h>
#include <Interpreters/IdentifierSemantic.h>
namespace DB
{
2020-04-22 06:01:33 +00:00
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);
}
}