-
Notifications
You must be signed in to change notification settings - Fork 1.6k
test: Fix flaky join tests #16860
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
Merged
Merged
test: Fix flaky join tests #16860
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4bf681f
Fix flaky join tests
2010YOUY01 2b8f2d9
fix flaky join slts
2010YOUY01 1fb418b
Update datafusion/sqllogictest/test_files/joins.slt
2010YOUY01 efd2bd5
Update datafusion/sqllogictest/test_files/joins.slt
2010YOUY01 bf5e6dd
Update datafusion/sqllogictest/test_files/joins.slt
2010YOUY01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Those 3 tests are supposed to test the
GlobalLimit
operator, instead of TopK, usingorder by
might change the test goal.To ensure those tests are deterministic, I set the limit to a number larger than the result set.
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.
good point
doesn't it also change the test goal though? for example, if the
LIMIT n
would passn+3
rows, this test would still passI don't think SLT with static expected values is a way to test
LIMIT n
at allwe need to accept this fact.
i am ok with the change proposed here, ie LIMIT being more than actual row count.
nit: let's maybe add a code comment that LIMIT should be more row count. This is so that when input data is changed and this test becomes flaky again, we still know how to fix 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.
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 review and suggested changes.
That's a great point. Yes, it still changes the test goal, but in my opinion, it's closer to the original test compared to TopK.
I think this case could be covered by a sqllogictest property check runner — one that detects queries with a global limit k and asserts that the final result size is <= k.
Implementing such a sqllogictest property check extension is on my to-do list, and I hope to find time to work on 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.
does sqllogictest have a reasonable way to add extensions? or do you mean modifying the upstream library?
at dbt we have some extensions to SLT, but they always feel like hacks at the code level (like special comments)
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.
No AFAIK, one of the recent extension is also a bit hacky #16183