Skip to content

Commit

Permalink
Fix WindowFuzzer to not generate NaN in frame bounds
Browse files Browse the repository at this point in the history
Summary:
Window fuzzer test is flaky due to incorrect handling of NaN in frame bounds in the Window operator (facebookincubator#11213). 
Presto needs to be fixed too to match Velox behavior (prestodb/presto#23822). 
Before then, make window fuzzer not generate NaN in frame bounds to avoid fuzzer failures.

Differential Revision: D64580491
  • Loading branch information
kagamiori authored and facebook-github-bot committed Oct 18, 2024
1 parent d42ec70 commit 10779d9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions velox/exec/fuzzer/WindowFuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,17 +319,18 @@ std::string WindowFuzzer::addKRangeOffsetColumnToInputImpl(
const SortingKeyAndOrder& orderByKey,
const std::string& columnName,
const std::string& offsetColumnName) {
// Generate frame bound (constant/column) without nulls.
ScopedVarSetter nullRatioHolder(
&vectorFuzzer_.getMutableOptions().nullRatio, 0.0);
ScopedVarSetter dataSpecHolder(
&vectorFuzzer_.getMutableOptions().dataSpec, {false, false});

// Use columns as frame bound 50% of time.
bool isColumnBound = vectorFuzzer_.coinToss(0.5);
const auto type = CppToType<T>::create();
VectorPtr constantFrameBound =
isColumnBound ? nullptr : vectorFuzzer_.fuzzConstant(type, 1);
VectorPtr columnFrameBound;
// Generate frame bound (constant/column) without nulls.
ScopedVarSetter nullRatioHolder(
&vectorFuzzer_.getMutableOptions().nullRatio, 0.0);
ScopedVarSetter dataSpecHolder(
&vectorFuzzer_.getMutableOptions().dataSpec, {false, false});
velox::test::VectorMaker vectorMaker{pool_.get()};

for (auto i = 0; i < FLAGS_num_batches; i++) {
Expand Down

0 comments on commit 10779d9

Please sign in to comment.