mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-17 13:13:36 +00:00
23 lines
545 B
C++
23 lines
545 B
C++
#pragma once
|
|
|
|
#include <Interpreters/InDepthNodeVisitor.h>
|
|
#include <Parsers/ASTIdentifier.h>
|
|
|
|
namespace DB
|
|
{
|
|
/// Data for RenameColumnVisitor which traverse tree and rename all columns with
|
|
/// name column_name to rename_to
|
|
struct RenameColumnData
|
|
{
|
|
using TypeToVisit = ASTIdentifier;
|
|
|
|
String column_name;
|
|
String rename_to;
|
|
|
|
void visit(ASTIdentifier & identifier, ASTPtr & ast) const;
|
|
};
|
|
|
|
using RenameColumnMatcher = OneTypeMatcher<RenameColumnData>;
|
|
using RenameColumnVisitor = InDepthNodeVisitor<RenameColumnMatcher, true>;
|
|
}
|