mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 20:02:05 +00:00
29 lines
582 B
C++
29 lines
582 B
C++
#pragma once
|
|
|
|
#include <Interpreters/InDepthNodeVisitor.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class ASTSelectQuery;
|
|
|
|
/// AST transformer. It replaces cross joins with equivalented inner join if possible.
|
|
class CrossToInnerJoinMatcher
|
|
{
|
|
public:
|
|
struct Data
|
|
{
|
|
bool done = false;
|
|
};
|
|
|
|
static bool needChildVisit(ASTPtr &, const ASTPtr &) { return true; }
|
|
static void visit(ASTPtr & ast, Data & data);
|
|
|
|
private:
|
|
static void visit(ASTSelectQuery & select, ASTPtr & ast, Data & data);
|
|
};
|
|
|
|
using CrossToInnerJoinVisitor = InDepthNodeVisitor<CrossToInnerJoinMatcher, true>;
|
|
|
|
}
|