-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add kRange preceding/following frames in window fuzzer #10006
Conversation
✅ Deploy Preview for meta-velox canceled.
|
b39549d
to
8b23836
Compare
8b23836
to
bf215b9
Compare
Hi @aditi-pandit, could you please help review these changes? The second commit contains changes specific to query runner context. |
bf215b9
to
2f7e509
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @pramodsatya, thank you for putting together this draft! I left some comments. Have you tried whether the current code already work properly with PrestoQueryRunner?
velox/exec/fuzzer/WindowFuzzer.cpp
Outdated
if constexpr (std::is_same_v<T, double> || std::is_same_v<T, float>) { | ||
return offsetCol[idx] - offsetValue; | ||
} else { | ||
return checkedMinus<T>(offsetCol[idx], offsetValue); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This piece of code is similar to lines 139-143. Could we reuse the code?
2f7e509
to
d3b207d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback @kagamiori. We found some result mismatches with Presto while testing with these changes and are investigating them further.
93ddd89
to
09e547b
Compare
09e547b
to
86393e2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @pramodsatya. This is beginning to look solid.
velox/exec/fuzzer/WindowFuzzer.cpp
Outdated
std::is_same_v<T, Timestamp> || | ||
std::is_same_v<T, UnknownValue>)) { | ||
auto size = vectorFuzzer_.getOptions().vectorSize; | ||
velox::test::VectorMaker vectorMaker{pool_.get()}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need vectorMaker for the rowVector at the end ? It seems un-necessary.
velox/exec/fuzzer/WindowFuzzer.cpp
Outdated
newNames.push_back(columnName); | ||
auto newChildren = input[i]->children(); | ||
newChildren.push_back(offsetColumn); | ||
input[i] = vectorMaker.rowVector(newNames, newChildren); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use makeRowVector here. Do we really need vectorMaker ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is in VectorTestBase and we don't derive from this class, vectorMaker is also used in AggregationFuzzerBase::generateInputData
. Creating a RowVectorPtr with std::make_shared
requires more changes and vectorMaker looks more convenient here. Could you please share if this is fine?
86393e2
to
46fd27a
Compare
46fd27a
to
2779a99
Compare
Hi @aditi-pandit, @kagamiori, could you please help review this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @pramodsatya.Only few minor comments left.
2779a99
to
bb039c8
Compare
Thanks @aditi-pandit, addressed the comments. |
@pramodsatya : Please rebase your code. There is a conflict. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @pramodsatya
bb039c8
to
9ebf74f
Compare
Hi @pramodsatya, is that failure still reproducible? If so, could you share which command you used to reproduce it? Thanks! |
Hi @kagamiori, the failure is not reproducible currently. It can be reproduced by reverting the changes to
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @pramodsatya, thank you for investigating the fuzzer failure! I can reproduce that bug, and as you explained, it was due to an incorrect use of inputMapping_ in WindowPartition::updateKRangeFrameBounds(). It's a great demonstration that this fuzzer enhancement enables us to catch a real bug.
Since this PR is already big, I wonder if we could separate the bug fix into another PR and add a unit test with that?
@kagamiori has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
ad8764e
to
b836009
Compare
Thanks for the feedback @kagamiori, addressed the comments and opened another PR for the null check fix: #11075 . Could you please take another look? |
b836009
to
0f8dafd
Compare
@kagamiori has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Hi @kagamiori, after the rebase, window fuzzer is failing with kRange frames when alternative plans are tested, I'm looking into it:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you for adding this support, iterating on this PR, and fixing the fuzzer-found bug!
0f8dafd
to
b962ca9
Compare
Hi @kagamiori, we investigated this error and it seems to be because of the recently added changes which enable the vector fuzzer to generate Nan and Infinity values. Nan and Infinity values are now accounted for when constructing the frame offset column and the error is fixed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @pramodsatya, I left one comment. The other part of this fix looks good to me. Thanks!
Co-authored-by: Minhan Cao <mcao@ibm.com>
b962ca9
to
906d532
Compare
Thanks for the suggestion @kagamiori, updated accordingly. Could you please help merge this change? |
@kagamiori has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Hi @pramodsatya, FYI, there was an internal linter complaint about defining a static variable in the header file VectorFuzzer.h. So I reverted the change in VectorFuzzer.h and VectorFuzzer.cpp, but instead declare the function I'm going to start the merging process now. |
Thanks for the update @kagamiori, sounds good. Please let me know if any other changes are needed. |
@kagamiori merged this pull request in ce035c8. |
Conbench analyzed the 1 benchmark run on commit There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
@pramodsatya Window fuzzer has been broken since this change, can you take a look? |
|
…ator#10006) Summary: 1. Adds support for kRange preceding/following frames in window fuzzer 2. Adds [reference query runner context](https://ibm.box.com/s/9tuk22hfp13imjwq9xelnz1dogsdgdh1) for PrestoSql frame clause for kRange preceding/following frames. Resolves facebookincubator#9572 . Pull Request resolved: facebookincubator#10006 Reviewed By: xiaoxmeng Differential Revision: D61882004 Pulled By: kagamiori fbshipit-source-id: 343201fc36e5c3c01779d73ff0888cd0597ba13c
preceding/following frames.
Resolves #9572 .