Skip to content

Commit

Permalink
feat(fuzzer): Change Join Fuzzer filter flag from boolean to double
Browse files Browse the repository at this point in the history
Summary: The change will allow for easier adjustment of the rate at which filters are added to plans.

Differential Revision: D67293806
  • Loading branch information
Daniel Hunte authored and facebook-github-bot committed Dec 16, 2024
1 parent ba43948 commit 5ad1ba7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions velox/exec/fuzzer/JoinFuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ DEFINE_bool(
"up after failures. Therefore, results are not compared when this is "
"enabled. Note that this option only works in debug builds.");

DEFINE_bool(
enable_filter,
false,
"Whether to test plans with filters enabled.");
DEFINE_double(
filter_ratio,
0,
"The chance of testing plans with filters enabled.");

namespace facebook::velox::exec::test {

Expand Down Expand Up @@ -1046,8 +1046,8 @@ void JoinFuzzer::verify(core::JoinType joinType) {
const bool nullAware =
isNullAwareSupported(joinType) && vectorFuzzer_.coinToss(0.5);

// Add boolean/integer join filter 10% of the time.
const bool withFilter = vectorFuzzer_.coinToss(0.1) && FLAGS_enable_filter;
// Add boolean/integer join filter.
const bool withFilter = vectorFuzzer_.coinToss(FLAGS_filter_ratio);
// Null-aware joins allow only one join key.
const int numKeys = nullAware ? (withFilter ? 0 : 1) : randInt(1, 5);
std::vector<TypePtr> keyTypes = generateJoinKeyTypes(numKeys);
Expand Down

0 comments on commit 5ad1ba7

Please sign in to comment.