From 227fa58b77fee2c056658291094a240fe309b062 Mon Sep 17 00:00:00 2001 From: Chang Chen Date: Fri, 21 Jun 2024 17:54:17 +0800 Subject: [PATCH] refactor test --- cpp-ch/local-engine/tests/gtest_parser.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/cpp-ch/local-engine/tests/gtest_parser.cpp b/cpp-ch/local-engine/tests/gtest_parser.cpp index 2038eb917c12..cbe41c90c81a 100644 --- a/cpp-ch/local-engine/tests/gtest_parser.cpp +++ b/cpp-ch/local-engine/tests/gtest_parser.cpp @@ -30,9 +30,10 @@ std::string splitBinaryFromJson(const std::string & json) return binary; } -TEST(SerializedPlanParser, CLICKHOUSE_65234) +std::string JsonPlanFor65234() { - String json = R"( + // Plan for https://github.com/ClickHouse/ClickHouse/pull/65234 + return R"( { "extensions": [{ "extensionFunction": { @@ -307,9 +308,13 @@ TEST(SerializedPlanParser, CLICKHOUSE_65234) }] } )"; - std::string split - = R"({"items":[{"uriFile":"file:///home/chang/SourceCode/rebase_gluten/backends-clickhouse/target/scala-2.12/test-classes/tests-working-home/tpch-data/supplier/part-00000-16caa751-9774-470c-bd37-5c84c53373c8-c000.snappy.parquet","length":"84633","parquet":{},"schema":{},"metadataColumns":[{}]}]}")"; +} + +TEST(SerializedPlanParser, PR65234) +{ + const std::string split + = R"({"items":[{"uriFile":"file:///part-00000-16caa751-9774-470c-bd37-5c84c53373c8-c000.snappy.parquet","length":"84633","parquet":{},"schema":{},"metadataColumns":[{}]}]}")"; SerializedPlanParser parser(SerializedPlanParser::global_context); parser.addSplitInfo(splitBinaryFromJson(split)); - parser.parseJson(json); + parser.parseJson(JsonPlanFor65234()); }