This is an automated email from the ASF dual-hosted git repository.

changchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git


The following commit(s) were added to refs/heads/main by this push:
     new b8a7d80df [GLUTEN-1632][CH]Daily Update Clickhouse Version (20240801) 
(#6665)
b8a7d80df is described below

commit b8a7d80df35183df97761ae5f499236a0c099f09
Author: Kyligence Git <[email protected]>
AuthorDate: Wed Jul 31 22:50:37 2024 -0500

    [GLUTEN-1632][CH]Daily Update Clickhouse Version (20240801) (#6665)
    
    * [GLUTEN-1632][CH]Daily Update Clickhouse Version (20240801)
    
    * Fix build due to https://github.com/ClickHouse/ClickHouse/pull/66528
    
    > It's being misused and leading to unnecessary copies.
    
    We misused using getSettings() in all place except CHUtils.cpp
    
    ---------
    
    Co-authored-by: kyligence-git <[email protected]>
    Co-authored-by: Chang Chen <[email protected]>
---
 cpp-ch/clickhouse.version                                  |  4 ++--
 cpp-ch/local-engine/Common/CHUtil.cpp                      |  2 +-
 cpp-ch/local-engine/Parser/CrossRelParser.cpp              |  2 +-
 cpp-ch/local-engine/Parser/JoinRelParser.cpp               |  2 +-
 cpp-ch/local-engine/Parser/MergeTreeRelParser.cpp          |  2 +-
 cpp-ch/local-engine/Shuffle/PartitionWriter.h              |  2 +-
 cpp-ch/local-engine/Storages/Mergetree/MetaDataHelper.cpp  |  2 +-
 .../Storages/SubstraitSource/ExcelTextFormatFile.cpp       | 14 +++++++-------
 .../local-engine/Storages/SubstraitSource/FormatFile.cpp   |  4 ++--
 cpp-ch/local-engine/tests/benchmark_local_engine.cpp       |  2 +-
 cpp-ch/local-engine/tests/gtest_ch_join.cpp                |  2 +-
 11 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/cpp-ch/clickhouse.version b/cpp-ch/clickhouse.version
index a69c80926..dd638c974 100644
--- a/cpp-ch/clickhouse.version
+++ b/cpp-ch/clickhouse.version
@@ -1,4 +1,4 @@
 CH_ORG=Kyligence
-CH_BRANCH=rebase_ch/20240730
-CH_COMMIT=f69def8b6a8
+CH_BRANCH=rebase_ch/20240801
+CH_COMMIT=768e193bd4d
 
diff --git a/cpp-ch/local-engine/Common/CHUtil.cpp 
b/cpp-ch/local-engine/Common/CHUtil.cpp
index e642a67a5..88867e290 100644
--- a/cpp-ch/local-engine/Common/CHUtil.cpp
+++ b/cpp-ch/local-engine/Common/CHUtil.cpp
@@ -1013,7 +1013,7 @@ void BackendInitializerUtil::updateConfig(const 
DB::ContextMutablePtr & context,
     // configs cannot be updated per query
     // settings can be updated per query
 
-    auto settings = context->getSettings(); // make a copy
+    auto settings = context->getSettingsCopy(); // make a copy
     initSettings(backend_conf_map, settings);
     updateNewSettings(context, settings);
 }
diff --git a/cpp-ch/local-engine/Parser/CrossRelParser.cpp 
b/cpp-ch/local-engine/Parser/CrossRelParser.cpp
index debfc2a1e..454f0387f 100644
--- a/cpp-ch/local-engine/Parser/CrossRelParser.cpp
+++ b/cpp-ch/local-engine/Parser/CrossRelParser.cpp
@@ -56,7 +56,7 @@ std::shared_ptr<DB::TableJoin> 
createCrossTableJoin(substrait::CrossRel_JoinType
 {
     auto & global_context = SerializedPlanParser::global_context;
     auto table_join = std::make_shared<TableJoin>(
-        global_context->getSettings(), 
global_context->getGlobalTemporaryVolume(), 
global_context->getTempDataOnDisk());
+        global_context->getSettingsRef(), 
global_context->getGlobalTemporaryVolume(), 
global_context->getTempDataOnDisk());
 
     std::pair<DB::JoinKind, DB::JoinStrictness> kind_and_strictness = 
JoinUtil::getCrossJoinKindAndStrictness(join_type);
     table_join->setKind(kind_and_strictness.first);
diff --git a/cpp-ch/local-engine/Parser/JoinRelParser.cpp 
b/cpp-ch/local-engine/Parser/JoinRelParser.cpp
index 8d0891bd0..8fbaf2fec 100644
--- a/cpp-ch/local-engine/Parser/JoinRelParser.cpp
+++ b/cpp-ch/local-engine/Parser/JoinRelParser.cpp
@@ -55,7 +55,7 @@ std::shared_ptr<DB::TableJoin> 
createDefaultTableJoin(substrait::JoinRel_JoinTyp
 {
     auto & global_context = SerializedPlanParser::global_context;
     auto table_join = std::make_shared<TableJoin>(
-        global_context->getSettings(), 
global_context->getGlobalTemporaryVolume(), 
global_context->getTempDataOnDisk());
+        global_context->getSettingsRef(), 
global_context->getGlobalTemporaryVolume(), 
global_context->getTempDataOnDisk());
 
     std::pair<DB::JoinKind, DB::JoinStrictness> kind_and_strictness = 
JoinUtil::getJoinKindAndStrictness(join_type, is_existence_join);
     table_join->setKind(kind_and_strictness.first);
diff --git a/cpp-ch/local-engine/Parser/MergeTreeRelParser.cpp 
b/cpp-ch/local-engine/Parser/MergeTreeRelParser.cpp
index 15e44b7ee..967f8ba70 100644
--- a/cpp-ch/local-engine/Parser/MergeTreeRelParser.cpp
+++ b/cpp-ch/local-engine/Parser/MergeTreeRelParser.cpp
@@ -185,7 +185,7 @@ DB::QueryPlanPtr MergeTreeRelParser::parseReadRel(
 
     auto ranges = merge_tree_table.extractRange(selected_parts);
     std::string ret;
-    if 
(context->getSettings().tryGetString("enabled_driver_filter_mergetree_index", 
ret) && ret == "'true'")
+    if 
(context->getSettingsRef().tryGetString("enabled_driver_filter_mergetree_index",
 ret) && ret == "'true'")
         storage->analysisPartsByRanges(*reinterpret_cast<ReadFromMergeTree 
*>(read_step.get()), ranges);
     else
         storage->wrapRangesInDataParts(*reinterpret_cast<ReadFromMergeTree 
*>(read_step.get()), ranges);
diff --git a/cpp-ch/local-engine/Shuffle/PartitionWriter.h 
b/cpp-ch/local-engine/Shuffle/PartitionWriter.h
index 0c3c0be50..78eb845e1 100644
--- a/cpp-ch/local-engine/Shuffle/PartitionWriter.h
+++ b/cpp-ch/local-engine/Shuffle/PartitionWriter.h
@@ -140,7 +140,7 @@ protected:
     {
         max_merge_block_size = options->split_size;
         max_sort_buffer_size = options->max_sort_buffer_size;
-        max_merge_block_bytes = 
SerializedPlanParser::global_context->getSettings().prefer_external_sort_block_bytes;
+        max_merge_block_bytes = 
SerializedPlanParser::global_context->getSettingsRef().prefer_external_sort_block_bytes;
     }
 public:
     String getName() const override { return "SortBasedPartitionWriter"; }
diff --git a/cpp-ch/local-engine/Storages/Mergetree/MetaDataHelper.cpp 
b/cpp-ch/local-engine/Storages/Mergetree/MetaDataHelper.cpp
index 8d43af068..ebc01544f 100644
--- a/cpp-ch/local-engine/Storages/Mergetree/MetaDataHelper.cpp
+++ b/cpp-ch/local-engine/Storages/Mergetree/MetaDataHelper.cpp
@@ -80,7 +80,7 @@ void restoreMetaData(CustomStorageMergeTreePtr & storage, 
const MergeTreeTable &
             return;
 
         // Increase the speed of metadata recovery
-        auto max_concurrency = std::max(10UL, 
SerializedPlanParser::global_context->getSettings().max_threads.value);
+        auto max_concurrency = std::max(10UL, 
SerializedPlanParser::global_context->getSettingsRef().max_threads.value);
         auto max_threads = std::min(max_concurrency, not_exists_part.size());
         FreeThreadPool thread_pool(
             CurrentMetrics::LocalThread,
diff --git 
a/cpp-ch/local-engine/Storages/SubstraitSource/ExcelTextFormatFile.cpp 
b/cpp-ch/local-engine/Storages/SubstraitSource/ExcelTextFormatFile.cpp
index 428ef5796..3bb73a856 100644
--- a/cpp-ch/local-engine/Storages/SubstraitSource/ExcelTextFormatFile.cpp
+++ b/cpp-ch/local-engine/Storages/SubstraitSource/ExcelTextFormatFile.cpp
@@ -99,14 +99,14 @@ DB::FormatSettings 
ExcelTextFormatFile::createFormatSettings()
         format_settings.csv.null_representation = 
file_info.text().null_value();
 
     bool empty_as_null = true;
-    if 
(context->getSettings().has(BackendInitializerUtil::EXCEL_EMPTY_AS_NULL))
-        empty_as_null = 
context->getSettings().getString(BackendInitializerUtil::EXCEL_EMPTY_AS_NULL) 
== "'true'";
+    if 
(context->getSettingsRef().has(BackendInitializerUtil::EXCEL_EMPTY_AS_NULL))
+        empty_as_null = 
context->getSettingsRef().getString(BackendInitializerUtil::EXCEL_EMPTY_AS_NULL)
 == "'true'";
 
     format_settings.try_infer_integers = 0;
-    if 
(!context->getSettings().has(BackendInitializerUtil::EXCEL_NUMBER_FORCE))
+    if 
(!context->getSettingsRef().has(BackendInitializerUtil::EXCEL_NUMBER_FORCE))
         format_settings.try_infer_integers = 1;
-    if (context->getSettings().has(BackendInitializerUtil::EXCEL_NUMBER_FORCE)
-        && 
context->getSettings().getString(BackendInitializerUtil::EXCEL_NUMBER_FORCE) == 
"'true'")
+    if 
(context->getSettingsRef().has(BackendInitializerUtil::EXCEL_NUMBER_FORCE)
+        && 
context->getSettingsRef().getString(BackendInitializerUtil::EXCEL_NUMBER_FORCE) 
== "'true'")
         format_settings.try_infer_integers = 1;
 
     if (format_settings.csv.null_representation.empty() || empty_as_null)
@@ -131,8 +131,8 @@ DB::FormatSettings 
ExcelTextFormatFile::createFormatSettings()
     {
         format_settings.csv.allow_single_quotes = false;
 
-        if 
(context->getSettings().has(BackendInitializerUtil::EXCEL_QUOTE_STRICT)
-            && 
context->getSettings().getString(BackendInitializerUtil::EXCEL_QUOTE_STRICT) == 
"'true'")
+        if 
(context->getSettingsRef().has(BackendInitializerUtil::EXCEL_QUOTE_STRICT)
+            && 
context->getSettingsRef().getString(BackendInitializerUtil::EXCEL_QUOTE_STRICT) 
== "'true'")
             format_settings.csv.allow_double_quotes = false;
         else
             format_settings.csv.allow_double_quotes = true;
diff --git a/cpp-ch/local-engine/Storages/SubstraitSource/FormatFile.cpp 
b/cpp-ch/local-engine/Storages/SubstraitSource/FormatFile.cpp
index 00acaf583..e449ede98 100644
--- a/cpp-ch/local-engine/Storages/SubstraitSource/FormatFile.cpp
+++ b/cpp-ch/local-engine/Storages/SubstraitSource/FormatFile.cpp
@@ -95,8 +95,8 @@ FormatFilePtr FormatFileUtil::createFile(
 #if USE_HIVE
     if (file.has_text())
     {
-        if 
(context->getSettings().has(BackendInitializerUtil::USE_EXCEL_PARSER)
-            && 
context->getSettings().getString(BackendInitializerUtil::USE_EXCEL_PARSER) == 
"'true'")
+        if 
(context->getSettingsRef().has(BackendInitializerUtil::USE_EXCEL_PARSER)
+            && 
context->getSettingsRef().getString(BackendInitializerUtil::USE_EXCEL_PARSER) 
== "'true'")
             return std::make_shared<ExcelTextFormatFile>(context, file, 
read_buffer_builder);
         else
             return std::make_shared<TextFormatFile>(context, file, 
read_buffer_builder);
diff --git a/cpp-ch/local-engine/tests/benchmark_local_engine.cpp 
b/cpp-ch/local-engine/tests/benchmark_local_engine.cpp
index 22b55ecf7..3402d5026 100644
--- a/cpp-ch/local-engine/tests/benchmark_local_engine.cpp
+++ b/cpp-ch/local-engine/tests/benchmark_local_engine.cpp
@@ -808,7 +808,7 @@ QueryPlanPtr readFromMergeTree(MergeTreeWithSnapshot 
storage)
 QueryPlanPtr joinPlan(QueryPlanPtr left, QueryPlanPtr right, String left_key, 
String right_key, size_t block_size = 8192)
 {
     auto join = std::make_shared<TableJoin>(
-        global_context->getSettings(), 
global_context->getGlobalTemporaryVolume(), 
global_context->getTempDataOnDisk());
+        global_context->getSettingsRef(), 
global_context->getGlobalTemporaryVolume(), 
global_context->getTempDataOnDisk());
     auto left_columns = 
left->getCurrentDataStream().header.getColumnsWithTypeAndName();
     auto right_columns = 
right->getCurrentDataStream().header.getColumnsWithTypeAndName();
     join->setKind(JoinKind::Left);
diff --git a/cpp-ch/local-engine/tests/gtest_ch_join.cpp 
b/cpp-ch/local-engine/tests/gtest_ch_join.cpp
index 93b567f3b..4885881f9 100644
--- a/cpp-ch/local-engine/tests/gtest_ch_join.cpp
+++ b/cpp-ch/local-engine/tests/gtest_ch_join.cpp
@@ -86,7 +86,7 @@ TEST(TestJoin, simple)
     
right_plan.addStep(std::make_unique<ReadFromPreparedSource>(Pipe(right_table)));
 
     auto join = std::make_shared<TableJoin>(
-        global_context->getSettings(), 
global_context->getGlobalTemporaryVolume(), 
global_context->getTempDataOnDisk());
+        global_context->getSettingsRef(), 
global_context->getGlobalTemporaryVolume(), 
global_context->getTempDataOnDisk());
     join->setKind(JoinKind::Left);
     join->setStrictness(JoinStrictness::All);
     join->setColumnsFromJoinedTable(right.getNamesAndTypesList());


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to