mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <Parsers/IAST.h>
|
|
#include <Interpreters/InDepthNodeVisitor.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class ASTSelectQuery;
|
|
struct SettingChange;
|
|
class SettingsChanges;
|
|
|
|
/// Pushdown SETTINGS clause that goes after FORMAT to the SELECT query:
|
|
/// (since settings after FORMAT parsed separatelly not in the ParserSelectQuery but in ParserQueryWithOutput)
|
|
///
|
|
/// SELECT 1 FORMAT Null SETTINGS max_block_size = 1 ->
|
|
/// SELECT 1 SETTINGS max_block_size = 1 FORMAT Null SETTINGS max_block_size = 1
|
|
///
|
|
/// Otherwise settings after FORMAT will not be applied.
|
|
class QueryWithOutputSettingsPushDownMatcher
|
|
{
|
|
public:
|
|
using Visitor = InDepthNodeVisitor<QueryWithOutputSettingsPushDownMatcher, true>;
|
|
|
|
struct Data
|
|
{
|
|
const ASTPtr & settings_ast;
|
|
};
|
|
|
|
static bool needChildVisit(ASTPtr & node, const ASTPtr & child);
|
|
static void visit(ASTPtr & ast, Data & data);
|
|
|
|
private:
|
|
static void visit(ASTSelectQuery &, ASTPtr &, Data &);
|
|
};
|
|
|
|
using QueryWithOutputSettingsPushDownVisitor = QueryWithOutputSettingsPushDownMatcher::Visitor;
|
|
|
|
}
|