mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 02:41:59 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
34 lines
788 B
C++
34 lines
788 B
C++
#pragma once
|
|
|
|
#include <Interpreters/InDepthNodeVisitor.h>
|
|
#include <Interpreters/Aliases.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class ASTSelectQuery;
|
|
struct TableWithColumnNamesAndTypes;
|
|
|
|
/// AST transformer. It replaces cross joins with equivalented inner join if possible.
|
|
class CrossToInnerJoinMatcher
|
|
{
|
|
public:
|
|
struct Data
|
|
{
|
|
const std::vector<TableWithColumnNamesAndTypes> & tables_with_columns;
|
|
const Aliases & aliases;
|
|
const String current_database;
|
|
bool done = false;
|
|
};
|
|
|
|
static bool needChildVisit(ASTPtr &, const ASTPtr &);
|
|
static void visit(ASTPtr & ast, Data & data);
|
|
|
|
private:
|
|
static void visit(ASTSelectQuery & select, ASTPtr & ast, Data & data);
|
|
};
|
|
|
|
using CrossToInnerJoinVisitor = InDepthNodeVisitor<CrossToInnerJoinMatcher, true>;
|
|
|
|
}
|