Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(spill): Only use query config to decide prefix sort enable status #12340

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 0 additions & 5 deletions velox/common/base/SpillConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ struct SpillConfig {
/// Checks if the given 'startBitOffset' has exceeded the max spill limit.
bool exceedSpillLevelLimit(uint8_t startBitOffset) const;

/// Returns true if prefix sort is enabled.
bool prefixSortEnabled() const {
return prefixSortConfig.has_value();
}

/// A callback function that returns the spill directory path. Implementations
/// can use it to ensure the path exists before returning.
GetSpillDirectoryPathCB getSpillDirPathCb;
Expand Down
6 changes: 3 additions & 3 deletions velox/exec/HashAggregation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void HashAggregation::initialize() {
isRawInput(aggregationNode_->step()),
aggregationNode_->globalGroupingSets(),
groupIdChannel,
spillConfig_.has_value() ? &spillConfig_.value() : nullptr,
spillConfig(),
&nonReclaimableSection_,
operatorCtx_.get(),
&spillStats_);
Expand All @@ -136,9 +136,9 @@ void HashAggregation::setupGroupingKeyChannelProjections(
groupingKeyProjections.emplace_back(
exprToChannel(groupingKeys[i].get(), inputType), i);
}

const auto& queryConfig = operatorCtx_->driverCtx()->queryConfig();
const bool reorderGroupingKeys =
canSpill() && spillConfig()->prefixSortEnabled();
canSpill() && queryConfig.spillPrefixSortEnabled();
// If prefix sort is enabled, we need to sort the grouping key's layout in the
// grouping set to maximize the prefix sort acceleration if spill is
// triggered. The reorder stores the grouping key with smaller prefix sort
Expand Down
Loading