Skip to content

Commit

Permalink
Re-enable spill in aggregation variance test (#9791)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #9791

Reviewed By: tanjialiang

Differential Revision: D57284297

Pulled By: xiaoxmeng

fbshipit-source-id: ed3d3899d15e13c7d05f572056f56a42abfdf3e6
  • Loading branch information
xiaoxmeng authored and facebook-github-bot committed May 13, 2024
1 parent f12c859 commit a54929b
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions velox/functions/lib/aggregates/tests/utils/AggregationTestBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -926,8 +926,6 @@ void AggregationTestBase::testAggregationsImpl(
assertResults(queryBuilder);
}

// TODO: turn on this after spilling for VarianceAggregationTest pass.
#if 0
if (!groupingKeys.empty() && allowInputShuffle_) {
SCOPED_TRACE("Run single with spilling");
PlanBuilder builder(pool());
Expand All @@ -947,19 +945,22 @@ void AggregationTestBase::testAggregationsImpl(
.config(core::QueryConfig::kAggregationSpillEnabled, "true")
.spillDirectory(spillDirectory->getPath());

TestScopedSpillInjection scopedSpillInjection(100);
exec::TestScopedSpillInjection scopedSpillInjection(100);
auto task = assertResults(queryBuilder);

// Expect > 0 spilled bytes unless there was no input.
auto inputRows =
toPlanStats(task->taskStats()).at(aggregationNodeId).inputRows;
if (inputRows > 1) {
EXPECT_LT(0, spilledBytes(*task));
if (exec::injectedSpillCount() > 0) {
EXPECT_LT(0, spilledBytes(*task))
<< " spilledRows: " << spilledRows(*task)
<< " spilledInputBytes: " << spilledInputBytes(*task)
<< " spilledFiles: " << spilledFiles(*task)
<< " injectedSpills: " << exec::injectedSpillCount();
} else {
EXPECT_EQ(0, spilledBytes(*task));
EXPECT_EQ(0, spilledBytes(*task))
<< " spilledRows: " << spilledRows(*task)
<< " spilledInputBytes: " << spilledInputBytes(*task)
<< " spilledFiles: " << spilledFiles(*task)
<< " injectedSpills: " << exec::injectedSpillCount();
}
}
#endif

{
SCOPED_TRACE("Run partial + intermediate + final");
Expand Down

0 comments on commit a54929b

Please sign in to comment.