felipecrv commented on code in PR #41335:
URL: https://github.com/apache/arrow/pull/41335#discussion_r1579669669
##########
cpp/src/arrow/acero/query_context.cc:
##########
@@ -23,6 +23,36 @@ namespace arrow {
using arrow::internal::CpuInfo;
namespace acero {
+namespace internal {
+
+int64_t GetTempStackSizeFromEnvVar() {
+ auto maybe_env_value = arrow::internal::GetEnvVar(kTempStackSizeEnvVar);
+ if (!maybe_env_value.ok()) {
+ return kDefaultTempStackSize;
+ }
+ auto env_value = *std::move(maybe_env_value);
+ if (env_value.empty()) {
+ return kDefaultTempStackSize;
+ }
+
+ int64_t temp_stack_size = 0;
+ size_t length = 0;
+ bool exception = false;
+ try {
+ temp_stack_size = std::stoll(env_value.c_str(), &length);
+ } catch (const std::exception&) {
+ exception = true;
+ }
+ if (length != env_value.length() || exception || temp_stack_size <= 0) {
Review Comment:
The default today is 256K, so a minimum of 64K seems reasonable.
64K is allocation granularity on Windows [1] and is a very common default in
Arrow (for other things) [2].
[1] https://devblogs.microsoft.com/oldnewthing/20031008-00/?p=42223
[2] https://github.com/search?q=repo%3Aapache%2Farrow%2064k&type=code
--
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]