2021-02-25 07:47:08 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <unordered_set>
|
|
|
|
|
|
|
|
#include <Interpreters/InDepthNodeVisitor.h>
|
2021-11-26 18:27:16 +00:00
|
|
|
#include <Parsers/IAST_fwd.h>
|
2021-02-25 07:47:08 +00:00
|
|
|
|
|
|
|
#include <Core/Settings.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class ASTFunction;
|
2021-11-26 18:27:16 +00:00
|
|
|
class ASTSelectWithUnionQuery;
|
2021-02-25 07:47:08 +00:00
|
|
|
|
|
|
|
class NormalizeSelectWithUnionQueryMatcher
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
struct Data
|
|
|
|
{
|
2022-08-30 10:09:01 +00:00
|
|
|
const SetOperationMode union_default_mode;
|
2021-02-25 07:47:08 +00:00
|
|
|
};
|
|
|
|
|
2021-08-16 12:03:55 +00:00
|
|
|
static void getSelectsFromUnionListNode(ASTPtr ast_select, ASTs & selects);
|
2021-02-25 07:47:08 +00:00
|
|
|
|
|
|
|
static void visit(ASTPtr & ast, Data &);
|
|
|
|
static void visit(ASTSelectWithUnionQuery &, Data &);
|
|
|
|
static bool needChildVisit(const ASTPtr &, const ASTPtr &) { return true; }
|
|
|
|
};
|
|
|
|
|
|
|
|
/// We need normalize children first, so we should visit AST tree bottom up
|
|
|
|
using NormalizeSelectWithUnionQueryVisitor
|
|
|
|
= InDepthNodeVisitor<NormalizeSelectWithUnionQueryMatcher, false>;
|
|
|
|
}
|