2022-06-08 17:14:03 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Parsers/IParserBase.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class ParserKQLStatement : public IParserBase
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const char * end;
|
|
|
|
bool allow_settings_after_format_in_insert;
|
|
|
|
const char * getName() const override { return "KQL Statement"; }
|
|
|
|
bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected) override;
|
2023-01-17 21:08:33 +00:00
|
|
|
|
2022-06-08 17:14:03 +00:00
|
|
|
public:
|
|
|
|
explicit ParserKQLStatement(const char * end_, bool allow_settings_after_format_in_insert_ = false)
|
2023-01-17 21:08:33 +00:00
|
|
|
: end(end_), allow_settings_after_format_in_insert(allow_settings_after_format_in_insert_)
|
|
|
|
{
|
|
|
|
}
|
2022-06-08 17:14:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class ParserKQLWithOutput : public IParserBase
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
const char * end;
|
|
|
|
bool allow_settings_after_format_in_insert;
|
|
|
|
const char * getName() const override { return "KQL with output"; }
|
|
|
|
bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected) override;
|
2023-01-17 21:08:33 +00:00
|
|
|
|
2022-06-08 17:14:03 +00:00
|
|
|
public:
|
|
|
|
explicit ParserKQLWithOutput(const char * end_, bool allow_settings_after_format_in_insert_ = false)
|
2023-01-17 21:08:33 +00:00
|
|
|
: end(end_), allow_settings_after_format_in_insert(allow_settings_after_format_in_insert_)
|
|
|
|
{
|
|
|
|
}
|
2022-06-08 17:14:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class ParserKQLWithUnionQuery : public IParserBase
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
const char * getName() const override { return "KQL query, possibly with UNION"; }
|
|
|
|
bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected) override;
|
|
|
|
};
|
|
|
|
|
2022-06-29 05:03:36 +00:00
|
|
|
class ParserKQLTaleFunction : public IParserBase
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
const char * getName() const override { return "KQL() function"; }
|
|
|
|
bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected) override;
|
|
|
|
};
|
|
|
|
|
2022-06-08 17:14:03 +00:00
|
|
|
}
|