ClickHouse/src/Parsers/ASTWindowDefinition.h

53 lines
1.2 KiB
C++
Raw Normal View History

2021-01-12 18:34:35 +00:00
#pragma once
2021-01-30 01:16:44 +00:00
#include <Interpreters/WindowDescription.h>
2021-01-19 01:00:39 +00:00
2021-01-12 18:34:35 +00:00
#include <Parsers/IAST.h>
namespace DB
{
struct ASTWindowDefinition : public IAST
{
2021-05-27 12:58:50 +00:00
std::string parent_window_name;
2021-01-12 18:34:35 +00:00
ASTPtr partition_by;
ASTPtr order_by;
2021-05-29 13:12:18 +00:00
bool frame_is_default = true;
WindowFrame::FrameType frame_type = WindowFrame::FrameType::Range;
WindowFrame::BoundaryType frame_begin_type = WindowFrame::BoundaryType::Unbounded;
ASTPtr frame_begin_offset;
2021-05-29 13:12:18 +00:00
bool frame_begin_preceding = true;
WindowFrame::BoundaryType frame_end_type = WindowFrame::BoundaryType::Current;
ASTPtr frame_end_offset;
2021-05-29 13:12:18 +00:00
bool frame_end_preceding = false;
2021-01-13 19:29:52 +00:00
2021-01-12 18:34:35 +00:00
ASTPtr clone() const override;
String getID(char delimiter) const override;
2021-01-13 19:29:52 +00:00
void formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override;
std::string getDefaultWindowName() const;
2021-01-12 18:34:35 +00:00
};
struct ASTWindowListElement : public IAST
{
String name;
// ASTWindowDefinition
ASTPtr definition;
2021-01-13 19:29:52 +00:00
2021-01-12 18:34:35 +00:00
ASTPtr clone() const override;
String getID(char delimiter) const override;
2021-01-13 19:29:52 +00:00
void formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override;
2021-01-12 18:34:35 +00:00
};
}