mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 05:22:17 +00:00
23 lines
570 B
C++
23 lines
570 B
C++
|
#include <Parsers/ASTSubquery.h>
|
||
|
#include <Parsers/ExpressionElementParsers.h>
|
||
|
#include <Parsers/ParserSelectQuery.h>
|
||
|
#include <Parsers/ParserUnionQueryElement.h>
|
||
|
#include <Common/typeid_cast.h>
|
||
|
|
||
|
|
||
|
namespace DB
|
||
|
{
|
||
|
|
||
|
bool ParserUnionQueryElement::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
|
||
|
{
|
||
|
if (!ParserSubquery().parse(pos, node, expected) && !ParserSelectQuery().parse(pos, node, expected))
|
||
|
return false;
|
||
|
|
||
|
if (auto * ast_sub_query = typeid_cast<ASTSubquery *>(node.get()))
|
||
|
node = ast_sub_query->children.at(0);
|
||
|
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
}
|