From de75fa000b7bc56d9680ebcf4ae1d4be80a05940 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Wed, 12 Jul 2017 05:46:51 +0300 Subject: [PATCH] Using lexer (incomplete) [#CLICKHOUSE-2]. --- dbms/src/Storages/MergeTree/ReshardingJob.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/dbms/src/Storages/MergeTree/ReshardingJob.cpp b/dbms/src/Storages/MergeTree/ReshardingJob.cpp index 71ebce4de63..ebf570c5696 100644 --- a/dbms/src/Storages/MergeTree/ReshardingJob.cpp +++ b/dbms/src/Storages/MergeTree/ReshardingJob.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include @@ -26,14 +27,8 @@ ReshardingJob::ReshardingJob(const std::string & serialized_job) std::string expr; readBinary(expr, buf); - IParser::Pos pos = expr.data(); - IParser::Pos max_parsed_pos = pos; - const char * end = pos + expr.size(); - ParserExpression parser; - Expected expected = ""; - if (!parser.parse(pos, end, sharding_key_expr, max_parsed_pos, expected)) - throw Exception{"ReshardingJob: cannot parse sharding expression.", ErrorCodes::LOGICAL_ERROR}; + sharding_key_expr = parseQuery(parser, expr.data(), expr.data() + expr.size(), "Sharding key expression"); readBinary(coordinator_id, buf); readVarUInt(block_number, buf);