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
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,18 @@ object VeloxConfig extends ConfigRegistry {
.doubleConf
.createWithDefault(0.1)

val MAX_EXTENDED_PARTIAL_AGGREGATION_MEMORY =
buildConf("spark.gluten.sql.columnar.backend.velox.maxExtendedPartialAggregationMemory")
.doc(
"Set the max extended memory of partial aggregation in bytes. When this option is set " +
"to a value greater than 0, it will override spark.gluten.sql.columnar.backend.velox." +
"maxExtendedPartialAggregationMemoryRatio. Note: this option only works when " +
"flushable partial aggregation is enabled. Ignored when " +
"spark.gluten.sql.columnar.backend.velox.flushablePartialAggregation=false."
)
.bytesConf(ByteUnit.BYTE)
.createOptional

val MAX_EXTENDED_PARTIAL_AGGREGATION_MEMORY_RATIO =
buildConf("spark.gluten.sql.columnar.backend.velox.maxExtendedPartialAggregationMemoryRatio")
.doc(
Expand Down
5 changes: 4 additions & 1 deletion cpp/velox/compute/WholeStageResultIterator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,10 @@ std::unordered_map<std::string, std::string> WholeStageResultIterator::getQueryC
: static_cast<int64_t>(veloxCfg_->get<double>(kMaxPartialAggregationMemoryRatio, 0.1) * offHeapMemory));
auto maxExtendedPartialAggregationMemory = std::max<int64_t>(
1 << 26,
static_cast<long>(veloxCfg_->get<double>(kMaxExtendedPartialAggregationMemoryRatio, 0.15) * offHeapMemory));
veloxCfg_->get<int64_t>(kMaxExtendedPartialAggregationMemory).has_value()
? veloxCfg_->get<int64_t>(kMaxExtendedPartialAggregationMemory).value()
: static_cast<int64_t>(
veloxCfg_->get<double>(kMaxExtendedPartialAggregationMemoryRatio, 0.15) * offHeapMemory));
configs[velox::core::QueryConfig::kMaxPartialAggregationMemory] = std::to_string(maxPartialAggregationMemory);
configs[velox::core::QueryConfig::kMaxExtendedPartialAggregationMemory] =
std::to_string(maxExtendedPartialAggregationMemory);
Expand Down
2 changes: 2 additions & 0 deletions cpp/velox/config/VeloxConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ const std::string kMaxPartialAggregationMemoryRatio =
const std::string kMaxPartialAggregationMemory = "spark.gluten.sql.columnar.backend.velox.maxPartialAggregationMemory";
const std::string kMaxExtendedPartialAggregationMemoryRatio =
"spark.gluten.sql.columnar.backend.velox.maxExtendedPartialAggregationMemoryRatio";
const std::string kMaxExtendedPartialAggregationMemory =
"spark.gluten.sql.columnar.backend.velox.maxExtendedPartialAggregationMemory";
const std::string kAbandonPartialAggregationMinPct =
"spark.gluten.sql.columnar.backend.velox.abandonPartialAggregationMinPct";
const std::string kAbandonPartialAggregationMinRows =
Expand Down
1 change: 1 addition & 0 deletions docs/velox-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ nav_order: 16
| spark.gluten.sql.columnar.backend.velox.maxCoalescedBytes | 64MB | Set the max coalesced bytes for velox file scan |
| spark.gluten.sql.columnar.backend.velox.maxCoalescedDistance | 512KB | Set the max coalesced distance bytes for velox file scan |
| spark.gluten.sql.columnar.backend.velox.maxCompiledRegexes | 100 | Controls maximum number of compiled regular expression patterns per function instance per thread of execution. |
| spark.gluten.sql.columnar.backend.velox.maxExtendedPartialAggregationMemory | &lt;undefined&gt; | Set the max extended memory of partial aggregation in bytes. When this option is set to a value greater than 0, it will override spark.gluten.sql.columnar.backend.velox.maxExtendedPartialAggregationMemoryRatio. Note: this option only works when flushable partial aggregation is enabled. Ignored when spark.gluten.sql.columnar.backend.velox.flushablePartialAggregation=false. |
| spark.gluten.sql.columnar.backend.velox.maxExtendedPartialAggregationMemoryRatio | 0.15 | Set the max extended memory of partial aggregation as maxExtendedPartialAggregationMemoryRatio of offheap size. Note: this option only works when flushable partial aggregation is enabled. Ignored when spark.gluten.sql.columnar.backend.velox.flushablePartialAggregation=false. |
| spark.gluten.sql.columnar.backend.velox.maxPartialAggregationMemory | &lt;undefined&gt; | Set the max memory of partial aggregation in bytes. When this option is set to a value greater than 0, it will override spark.gluten.sql.columnar.backend.velox.maxPartialAggregationMemoryRatio. Note: this option only works when flushable partial aggregation is enabled. Ignored when spark.gluten.sql.columnar.backend.velox.flushablePartialAggregation=false. |
| spark.gluten.sql.columnar.backend.velox.maxPartialAggregationMemoryRatio | 0.1 | Set the max memory of partial aggregation as maxPartialAggregationMemoryRatio of offheap size. Note: this option only works when flushable partial aggregation is enabled. Ignored when spark.gluten.sql.columnar.backend.velox.flushablePartialAggregation=false. |
Expand Down