2016-07-18 00:14:24 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <Parsers/IParserBase.h>
|
2016-07-18 00:14:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2020-07-16 08:56:45 +00:00
|
|
|
struct ASTTableJoin;
|
|
|
|
|
2016-07-18 00:14:24 +00:00
|
|
|
/** List of single or multiple JOIN-ed tables or subqueries in SELECT query, with ARRAY JOINs and SAMPLE, FINAL modifiers.
|
|
|
|
*/
|
|
|
|
class ParserTablesInSelectQuery : public IParserBase
|
|
|
|
{
|
|
|
|
protected:
|
2020-01-21 08:54:26 +00:00
|
|
|
const char * getName() const override { return "table, table function, subquery or list of joined tables"; }
|
|
|
|
bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected) override;
|
2016-07-18 00:14:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class ParserTablesInSelectQueryElement : public IParserBase
|
|
|
|
{
|
|
|
|
public:
|
2019-08-03 11:02:40 +00:00
|
|
|
ParserTablesInSelectQueryElement(bool is_first_) : is_first(is_first_) {}
|
2016-07-18 00:14:24 +00:00
|
|
|
|
|
|
|
protected:
|
2020-01-21 08:54:26 +00:00
|
|
|
const char * getName() const override { return "table, table function, subquery or list of joined tables"; }
|
|
|
|
bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected) override;
|
2016-07-18 00:14:24 +00:00
|
|
|
|
|
|
|
private:
|
2017-04-01 07:20:54 +00:00
|
|
|
bool is_first;
|
2020-07-16 08:56:45 +00:00
|
|
|
|
|
|
|
static void parseJoinStrictness(Pos & pos, ASTTableJoin & table_join);
|
2016-07-18 00:14:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class ParserTableExpression : public IParserBase
|
|
|
|
{
|
|
|
|
protected:
|
2020-01-21 08:54:26 +00:00
|
|
|
const char * getName() const override { return "table or subquery or table function"; }
|
|
|
|
bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected) override;
|
2016-07-18 00:14:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class ParserArrayJoin : public IParserBase
|
|
|
|
{
|
|
|
|
protected:
|
2020-01-21 08:54:26 +00:00
|
|
|
const char * getName() const override { return "array join"; }
|
|
|
|
bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected) override;
|
2016-07-18 00:14:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|