mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-14 10:22:10 +00:00
28 lines
703 B
C++
28 lines
703 B
C++
#include <cstdlib>
|
|
#include <Parsers/ExpressionListParsers.h>
|
|
#include <Parsers/IParserBase.h>
|
|
#include <Parsers/Kusto/ParserKQLLimit.h>
|
|
#include <Parsers/Kusto/ParserKQLQuery.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
bool ParserKQLLimit::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
|
|
{
|
|
ASTPtr limit_length;
|
|
|
|
auto expr = getExprFromToken(pos);
|
|
|
|
Tokens tokens(expr.c_str(), expr.c_str() + expr.size());
|
|
IParser::Pos new_pos(tokens, pos.max_depth);
|
|
|
|
if (!ParserExpressionWithOptionalAlias(false).parse(new_pos, limit_length, expected))
|
|
return false;
|
|
|
|
node->as<ASTSelectQuery>()->setExpression(ASTSelectQuery::Expression::LIMIT_LENGTH, std::move(limit_length));
|
|
|
|
return true;
|
|
}
|
|
|
|
}
|