Skip to content

Commit

Permalink
Fix WindowFuzzer to not generate NaN in frame bounds (#11296)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #11296

Window fuzzer test is flaky due to incorrect handling of NaN in frame bounds in the Window operator (#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.

Reviewed By: amitkdutta

Differential Revision: D64580491

fbshipit-source-id: 28c0a26983c3fa8a78543d1b77691019dd70ffb0
  • Loading branch information
kagamiori authored and facebook-github-bot committed Oct 18, 2024
1 parent 6657424 commit bc8c905
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 bc8c905

Please sign in to comment.