Using lexer (incomplete) [#CLICKHOUSE-2].

This commit is contained in:
Alexey Milovidov 2017-07-12 05:46:51 +03:00 committed by alexey-milovidov
parent 2073fef375
commit de75fa000b

View File

@ -4,6 +4,7 @@
#include <IO/WriteBufferFromString.h> #include <IO/WriteBufferFromString.h>
#include <IO/WriteHelpers.h> #include <IO/WriteHelpers.h>
#include <Parsers/ExpressionListParsers.h> #include <Parsers/ExpressionListParsers.h>
#include <Parsers/parseQuery.h>
#include <Parsers/queryToString.h> #include <Parsers/queryToString.h>
@ -26,14 +27,8 @@ ReshardingJob::ReshardingJob(const std::string & serialized_job)
std::string expr; std::string expr;
readBinary(expr, buf); readBinary(expr, buf);
IParser::Pos pos = expr.data();
IParser::Pos max_parsed_pos = pos;
const char * end = pos + expr.size();
ParserExpression parser; ParserExpression parser;
Expected expected = ""; sharding_key_expr = parseQuery(parser, expr.data(), expr.data() + expr.size(), "Sharding key expression");
if (!parser.parse(pos, end, sharding_key_expr, max_parsed_pos, expected))
throw Exception{"ReshardingJob: cannot parse sharding expression.", ErrorCodes::LOGICAL_ERROR};
readBinary(coordinator_id, buf); readBinary(coordinator_id, buf);
readVarUInt(block_number, buf); readVarUInt(block_number, buf);