Skip to content

Commit

Permalink
Add max spill level in RowNumber fuzzer (facebookincubator#10347)
Browse files Browse the repository at this point in the history
Summary:
Add a max spill level config in the RowNumberFuzzer.

Pull Request resolved: facebookincubator#10347

Reviewed By: tanjialiang

Differential Revision: D59232589

Pulled By: xiaoxmeng

fbshipit-source-id: 95a2d37d387c5767cb61444d37a154d936571a2b
  • Loading branch information
duanmeng authored and facebook-github-bot committed Jul 1, 2024
1 parent 181c6ae commit 6caa7d5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions velox/exec/fuzzer/RowNumberFuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ DEFINE_double(

DEFINE_bool(enable_spill, true, "Whether to test plans with spilling enabled.");

DEFINE_int32(
max_spill_level,
-1,
"Max spill level, -1 means random [0, 7], otherwise the actual level.");

DEFINE_bool(
enable_oom_injection,
false,
Expand Down Expand Up @@ -280,7 +285,10 @@ RowVectorPtr RowNumberFuzzer::execute(
int32_t spillPct{0};
if (injectSpill) {
spillDirectory = exec::test::TempDirectoryPath::create();
const auto maxSpillLevel =
FLAGS_max_spill_level == -1 ? randInt(0, 7) : FLAGS_max_spill_level;
builder.config(core::QueryConfig::kSpillEnabled, true)
.config(core::QueryConfig::kMaxSpillLevel, maxSpillLevel)
.config(core::QueryConfig::kRowNumberSpillEnabled, true)
.spillDirectory(spillDirectory->getPath());
spillPct = 10;
Expand Down

0 comments on commit 6caa7d5

Please sign in to comment.