aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Interpreters/RenameColumnVisitor.cpp
blob: c80271805478ab2db7f45b0a0def1cf4ff7ae3ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#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);
}

}