From dfb6226315201efa39dcb22a44b8549f08b3ae36 Mon Sep 17 00:00:00 2001 From: Kyligence Git Date: Sat, 17 Aug 2024 10:16:22 -0500 Subject: [PATCH] [GLUTEN-1632][CH]Daily Update Clickhouse Version (20240817) (#6903) * [GLUTEN-1632][CH]Daily Update Clickhouse Version (20240817) * Add ut for https://github.com/ClickHouse/ClickHouse/pull/68131 > Refer https://github.com/ClickHouse/ClickHouse/pull/68494 (cherry picked from commit 9ec7071c3a0b00038989bdad0891842472d13098) --------- Co-authored-by: kyligence-git Co-authored-by: Chang Chen --- cpp-ch/clickhouse.version | 4 +- cpp-ch/local-engine/tests/data/68131.parquet | Bin 0 -> 289 bytes .../tests/gtest_clickhouse_pr_verify.cpp | 24 ++++- .../tests/json/clickhouse_pr_68131.json | 95 ++++++++++++++++++ 4 files changed, 119 insertions(+), 4 deletions(-) create mode 100644 cpp-ch/local-engine/tests/data/68131.parquet create mode 100644 cpp-ch/local-engine/tests/json/clickhouse_pr_68131.json diff --git a/cpp-ch/clickhouse.version b/cpp-ch/clickhouse.version index 7c93bc1240ce..d41875c54d7d 100644 --- a/cpp-ch/clickhouse.version +++ b/cpp-ch/clickhouse.version @@ -1,3 +1,3 @@ CH_ORG=Kyligence -CH_BRANCH=rebase_ch/20240815 -CH_COMMIT=d87dbba64fc +CH_BRANCH=rebase_ch/20240817 +CH_COMMIT=ed191291681 diff --git a/cpp-ch/local-engine/tests/data/68131.parquet b/cpp-ch/local-engine/tests/data/68131.parquet new file mode 100644 index 0000000000000000000000000000000000000000..169f6152003db164c78e33cd69205caa33f906b5 GIT binary patch literal 289 zcmXAl!D_=W42Bgqgq#M0O4Q&(E)5xMp|QKBgsetSetting("enable_named_columns_in_function_tuple", DB::Field(true)); - auto settingxs = context1->getSettingsRef(); - EXPECT_FALSE(settingxs.enable_named_columns_in_function_tuple) << "GLUTEN NEED set enable_named_columns_in_function_tuple to false"; + auto settings = context1->getSettingsRef(); + EXPECT_FALSE(settings.enable_named_columns_in_function_tuple) << "GLUTEN NEED set enable_named_columns_in_function_tuple to false"; const std::string split_template = R"({"items":[{"uriFile":"{replace_local_files}","partitionIndex":"0","length":"1529","parquet":{},"schema":{},"metadataColumns":[{}]}]})"; @@ -112,6 +112,26 @@ TEST(Clickhouse, PR68135) const auto plan = local_engine::JsonStringToMessage( {reinterpret_cast(gresource_embedded_pr_68135_jsonData), gresource_embedded_pr_68135_jsonSize}); + auto local_executor = parser.createExecutor(plan); + EXPECT_TRUE(local_executor->hasNext()); + const Block & x = *local_executor->nextColumnar(); + debug::headBlock(x); +} + +INCBIN(resource_embedded_pr_68131_json, SOURCE_DIR "/utils/extern-local-engine/tests/json/clickhouse_pr_68131.json"); +TEST(Clickhouse, PR68131) +{ + const std::string split_template + = R"({"items":[{"uriFile":"{replace_local_files}","partitionIndex":"0","length":"289","parquet":{},"schema":{},"metadataColumns":[{}]}]})"; + const std::string split + = replaceLocalFilesWildcards(split_template, GLUTEN_DATA_DIR("/utils/extern-local-engine/tests/data/68131.parquet")); + + SerializedPlanParser parser(SerializedPlanParser::global_context); + parser.addSplitInfo(local_engine::JsonStringToBinary(split)); + + const auto plan = local_engine::JsonStringToMessage( + {reinterpret_cast(gresource_embedded_pr_68131_jsonData), gresource_embedded_pr_68131_jsonSize}); + auto local_executor = parser.createExecutor(plan); EXPECT_TRUE(local_executor->hasNext()); const Block & x = *local_executor->nextColumnar(); diff --git a/cpp-ch/local-engine/tests/json/clickhouse_pr_68131.json b/cpp-ch/local-engine/tests/json/clickhouse_pr_68131.json new file mode 100644 index 000000000000..0add2092b817 --- /dev/null +++ b/cpp-ch/local-engine/tests/json/clickhouse_pr_68131.json @@ -0,0 +1,95 @@ +{ + "extensions": [ + { + "extensionFunction": { + "name": "is_not_null:list" + } + } + ], + "relations": [ + { + "root": { + "input": { + "filter": { + "common": { + "direct": {} + }, + "input": { + "read": { + "common": { + "direct": {} + }, + "baseSchema": { + "names": [ + "f" + ], + "struct": { + "types": [ + { + "list": { + "type": { + "i32": { + "nullability": "NULLABILITY_NULLABLE" + } + }, + "nullability": "NULLABILITY_NULLABLE" + } + } + ] + }, + "columnTypes": [ + "NORMAL_COL" + ] + }, + "advancedExtension": { + "optimization": { + "@type": "type.googleapis.com/google.protobuf.StringValue", + "value": "isMergeTree=0\n" + } + } + } + }, + "condition": { + "scalarFunction": { + "outputType": { + "bool": { + "nullability": "NULLABILITY_REQUIRED" + } + }, + "arguments": [ + { + "value": { + "selection": { + "directReference": { + "structField": {} + } + } + } + } + ] + } + } + } + }, + "names": [ + "f#0" + ], + "outputSchema": { + "types": [ + { + "list": { + "type": { + "i32": { + "nullability": "NULLABILITY_NULLABLE" + } + }, + "nullability": "NULLABILITY_REQUIRED" + } + } + ], + "nullability": "NULLABILITY_REQUIRED" + } + } + } + ] +} \ No newline at end of file