Skip to content

Commit

Permalink
[GLUTEN-1632][CH]Daily Update Clickhouse Version (20240817) (#6903)
Browse files Browse the repository at this point in the history
* [GLUTEN-1632][CH]Daily Update Clickhouse Version (20240817)

* Add ut for  ClickHouse/ClickHouse#68131

> Refer ClickHouse/ClickHouse#68494

(cherry picked from commit 9ec7071c3a0b00038989bdad0891842472d13098)

---------

Co-authored-by: kyligence-git <[email protected]>
Co-authored-by: Chang Chen <[email protected]>
  • Loading branch information
3 people authored Aug 17, 2024
1 parent f41129e commit 9fcd488
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cpp-ch/clickhouse.version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CH_ORG=Kyligence
CH_BRANCH=rebase_ch/20240815
CH_COMMIT=d87dbba64fc
CH_BRANCH=rebase_ch/20240817
CH_COMMIT=ed191291681
Binary file added cpp-ch/local-engine/tests/data/68131.parquet
Binary file not shown.
24 changes: 22 additions & 2 deletions cpp-ch/local-engine/tests/gtest_clickhouse_pr_verify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ TEST(Clickhouse, PR54881)
{
const auto context1 = DB::Context::createCopy(SerializedPlanParser::global_context);
// context1->setSetting("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":[{}]}]})";
Expand Down Expand Up @@ -112,6 +112,26 @@ TEST(Clickhouse, PR68135)
const auto plan = local_engine::JsonStringToMessage<substrait::Plan>(
{reinterpret_cast<const char *>(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<substrait::ReadRel::LocalFiles>(split));

const auto plan = local_engine::JsonStringToMessage<substrait::Plan>(
{reinterpret_cast<const char *>(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();
Expand Down
95 changes: 95 additions & 0 deletions cpp-ch/local-engine/tests/json/clickhouse_pr_68131.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"extensions": [
{
"extensionFunction": {
"name": "is_not_null:list<i32>"
}
}
],
"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"
}
}
}
]
}

0 comments on commit 9fcd488

Please sign in to comment.