mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 13:42:02 +00:00
28 lines
798 B
C++
28 lines
798 B
C++
#pragma once
|
|
|
|
#include <Parsers/IAST.h>
|
|
#include <Parsers/ASTIdentifier.h>
|
|
#include <Interpreters/InDepthNodeVisitor.h>
|
|
#include <Interpreters/DatabaseAndTableWithAlias.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
struct FindIdentifierBestTableData
|
|
{
|
|
using TypeToVisit = ASTIdentifier;
|
|
using IdentifierWithTable = std::pair<ASTIdentifier *, const DatabaseAndTableWithAlias *>;
|
|
|
|
const std::vector<TableWithColumnNames> & tables;
|
|
std::vector<IdentifierWithTable> identifier_table;
|
|
|
|
FindIdentifierBestTableData(const std::vector<TableWithColumnNames> & tables_);
|
|
|
|
void visit(ASTIdentifier & identifier, ASTPtr &);
|
|
};
|
|
|
|
using FindIdentifierBestTableMatcher = OneTypeMatcher<FindIdentifierBestTableData>;
|
|
using FindIdentifierBestTableVisitor = InDepthNodeVisitor<FindIdentifierBestTableMatcher, true>;
|
|
|
|
}
|