zhanglistar commented on code in PR #5893:
URL: https://github.com/apache/incubator-gluten/pull/5893#discussion_r1618153459
##########
cpp-ch/local-engine/Common/CHUtil.cpp:
##########
@@ -672,6 +678,21 @@ void
BackendInitializerUtil::initSettings(std::map<std::string, std::string> & b
settings.set("function_json_value_return_type_allow_complex", true);
settings.set("function_json_value_return_type_allow_nullable", true);
settings.set("precise_float_parsing", true);
+ if (backend_conf_map.contains(GLUTEN_TASK_OFFHEAP))
+ {
+ auto task_memory =
std::stoull(backend_conf_map.at(GLUTEN_TASK_OFFHEAP));
+ if (!backend_conf_map.contains(CH_RUNTIME_SETTINGS_PREFIX +
"max_bytes_before_external_sort"))
+ {
+ settings.max_bytes_before_external_sort = static_cast<size_t>(0.8
* task_memory);
+ }
+ if (!backend_conf_map.contains(CH_RUNTIME_SETTINGS_PREFIX +
"prefer_external_sort_block_bytes"))
+ {
+ auto mem_gb = task_memory / static_cast<double>(1_GiB);
+ // 2.8x+5, Heuristics calculate the block size of external sort,
[8,16]
Review Comment:
Just curious, how to get this formula?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]