Skip to content

Commit

Permalink
refactor logics about jit settings
Browse files Browse the repository at this point in the history
  • Loading branch information
taiyang-li committed Oct 15, 2024
1 parent 0bc6613 commit f27586f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions cpp-ch/local-engine/Common/CHUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,12 +705,14 @@ DB::Field BackendInitializerUtil::toField(const String & key, const String & val

void BackendInitializerUtil::initSettings(const std::map<std::string, std::string> & spark_conf_map, DB::Settings & settings)
{
/// Initialize default setting.
/// Initialize default setting. Could be overrided by spark_conf_map
settings.set("date_time_input_format", "best_effort");
settings.set(MERGETREE_MERGE_AFTER_INSERT, true);
settings.set(MERGETREE_INSERT_WITHOUT_LOCAL_STORAGE, false);
settings.set(DECIMAL_OPERATIONS_ALLOW_PREC_LOSS, true);
settings.set("remote_filesystem_read_prefetch", false);
settings.set("compile_expressions", true); // Enable JIT by default, which is different from ClickHouse
settings.set("min_count_to_compile_expression", 0); // Compile expression no matter how many times it appears

for (const auto & [key, value] : spark_conf_map)
{
Expand Down Expand Up @@ -756,7 +758,8 @@ void BackendInitializerUtil::initSettings(const std::map<std::string, std::strin
LOG_DEBUG(&Poco::Logger::get("CHUtil"), "Set settings key:{} value:{}", key, value);
}
}
/// Finally apply some fixed kvs to settings.

/// Finally apply some fixed kvs to settings. Could not be overrided by spark_conf_map
settings.set("join_use_nulls", true);
settings.set("input_format_orc_allow_missing_columns", true);
settings.set("input_format_orc_case_insensitive_column_matching", true);
Expand Down
4 changes: 2 additions & 2 deletions cpp-ch/local-engine/Parser/SerializedPlanParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,11 @@ DB::QueryPipelineBuilderPtr SerializedPlanParser::buildQueryPipeline(DB::QueryPl
settings,
0);
const QueryPlanOptimizationSettings optimization_settings{.optimize_plan = settings[Setting::query_plan_enable_optimizations]};
ExpressionActionsSettings actions_settings = ExpressionActionsSettings::fromContext(context, CompileExpressions::yes);
return query_plan.buildQueryPipeline(
optimization_settings,
BuildQueryPipelineSettings{
.actions_settings
= ExpressionActionsSettings{.can_compile_expressions = true, .min_count_to_compile_expression = 3, .compile_expressions = CompileExpressions::yes},
.actions_settings = actions_settings,
.process_list_element = query_status});
}

Expand Down

0 comments on commit f27586f

Please sign in to comment.