Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/20250110
CH_COMMIT=eafc5ef70b3
CH_BRANCH=rebase_ch/20250115
CH_COMMIT=8e0d5eaf0fc
16 changes: 14 additions & 2 deletions cpp-ch/local-engine/Common/CHUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ namespace ServerSetting
extern const ServerSettingsString primary_index_cache_policy;
extern const ServerSettingsUInt64 primary_index_cache_size;
extern const ServerSettingsDouble primary_index_cache_size_ratio;
extern const ServerSettingsString skipping_index_cache_policy;
extern const ServerSettingsUInt64 skipping_index_cache_size;
extern const ServerSettingsUInt64 skipping_index_cache_max_entries;
extern const ServerSettingsDouble skipping_index_cache_size_ratio;
}
namespace Setting
{
Expand Down Expand Up @@ -762,11 +766,11 @@ void BackendInitializerUtil::initContexts(DB::Context::ConfigurationPtr config)
global_context->setConfig(config);

auto tmp_path = config->getString("tmp_path", PathConfig::DEFAULT_TEMP_FILE_PATH);
if(config->getBool(PathConfig::USE_CURRENT_DIRECTORY_AS_TMP, false))
if (config->getBool(PathConfig::USE_CURRENT_DIRECTORY_AS_TMP, false))
{
char buffer[PATH_MAX];
if (getcwd(buffer, sizeof(buffer)) != nullptr)
tmp_path = std::string(buffer) + tmp_path;
tmp_path = std::string(buffer) + tmp_path;
};

global_context->setTemporaryStoragePath(tmp_path, 0);
Expand Down Expand Up @@ -805,6 +809,14 @@ void BackendInitializerUtil::initContexts(DB::Context::ConfigurationPtr config)
double index_mark_cache_size_ratio = config->getDouble("index_mark_cache_size_ratio", DEFAULT_INDEX_MARK_CACHE_SIZE_RATIO);
global_context->setIndexMarkCache(index_mark_cache_policy, index_mark_cache_size, index_mark_cache_size_ratio);

String skipping_index_cache_policy = server_settings[ServerSetting::skipping_index_cache_policy];
size_t skipping_index_cache_size = server_settings[ServerSetting::skipping_index_cache_size];
size_t skipping_index_cache_max_entries = server_settings[ServerSetting::skipping_index_cache_max_entries];
double skipping_index_cache_size_ratio = server_settings[ServerSetting::skipping_index_cache_size_ratio];
LOG_INFO(log, "Skipping index cache size to {}", formatReadableSizeWithBinarySuffix(skipping_index_cache_size));
global_context->setSkippingIndexCache(
skipping_index_cache_policy, skipping_index_cache_size, skipping_index_cache_max_entries, skipping_index_cache_size_ratio);

size_t mmap_cache_size = config->getUInt64("mmap_cache_size", DEFAULT_MMAP_CACHE_MAX_SIZE);
global_context->setMMappedFileCache(mmap_cache_size);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "MergeSparkMergeTreeTask.h"

#include <Interpreters/TransactionLog.h>
#include <Storages/MergeTree/Compaction/CompactionStatistics.h>
#include <Storages/MergeTree/MergeTreeData.h>
#include <Storages/MergeTree/MergeTreeDataMergerMutator.h>
#include <Storages/MergeTree/SparkStorageMergeTree.h>
Expand Down Expand Up @@ -149,8 +150,7 @@ void MergeSparkMergeTreeTask::prepare()
task_context,
//merge_mutate_entry->tagger->reserved_space,
storage.tryReserveSpace(
MergeTreeDataMergerMutator::estimateNeededDiskSpace(future_part->parts),
future_part->parts[0]->getDataPartStorage()),
CompactionStatistics::estimateNeededDiskSpace(future_part->parts), future_part->parts[0]->getDataPartStorage()),
deduplicate,
deduplicate_by_columns,
cleanup,
Expand Down