ClickHouse/src/Interpreters/CrossToInnerJoinVisitor.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
808 B
C++
Raw Normal View History

2019-02-01 16:36:40 +00:00
#pragma once
#include <Interpreters/InDepthNodeVisitor.h>
#include <Interpreters/Aliases.h>
2019-02-01 16:36:40 +00:00
namespace DB
{
class ASTSelectQuery;
struct TableWithColumnNamesAndTypes;
2019-02-01 16:36:40 +00:00
/// 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;
UInt8 cross_to_inner_join_rewrite = 1;
2019-02-01 16:36:40 +00:00
};
static bool needChildVisit(ASTPtr &, const ASTPtr &);
2019-02-22 13:33:56 +00:00
static void visit(ASTPtr & ast, Data & data);
2019-02-01 16:36:40 +00:00
private:
static void visit(ASTSelectQuery & select, ASTPtr & ast, Data & data);
};
using CrossToInnerJoinVisitor = InDepthNodeVisitor<CrossToInnerJoinMatcher, true>;
}