You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flaky fuzz tests for filtered outer SortMergeJoin #12359
After replacing the filter for join fuzz tests with the selective one (that doesn't return 100% of input rows), it turned out that following tests may periodically fail for HashJoin vs SortMergeJoin cases:
test_left_join_1k_filtered
test_right_join_1k_filtered
test_full_join_1k_filtered
To Reproduce
To reproduce this one should add JoinTestType::HjSmj to mentioned above test cases and run them (likely a couple of times)
Expected behavior
SMJ and HJ should return equal resultsets for these test cases
I believe all of them flaky because of flaky LeftAnti join, all Left, Right, Full depends on LeftAnti starting from #10892 PR.
Checking if thats the case
For LeftOuter/RightOuter and FullJoin the rootcause is the same. SMJ emits a null row if the filtered match is not found.
But if the filtered match row is found it should emit the joined row instead of null row. And here we come to the same issue as for LeftAnti, so we need to know when all the right rows processed for the given left row.
Given that SMJ emits rows in freeze_streamed which can be called anytime once the output size is equal to batch size there is 2 possible options:
Try to calculate if the SMJ is about to switch to ordering == Less which moves left pointer down, meaning everything is processed for the row
Move emit to some other place, for example we can fill the buffer with rows and filtered flags until the ordering switch, and only then make a final emit based on the data in the buffer + filtered
Activity
comphead commentedon Sep 8, 2024
left_semi_joinwas fixed sometime ago. Need to check whats happening withThe repro case is to run the same test 1000 times and depending on data distribution between batches the problem can arise
comphead commentedon Sep 10, 2024
fyi @viirya
comphead commentedon Sep 12, 2024
I believe all of them flaky because of flaky LeftAnti join, all Left, Right, Full depends on LeftAnti starting from #10892 PR.
Checking if thats the case
comphead commentedon Sep 12, 2024
Simple test case for LeftOuter
@viirya cc
comphead commentedon Sep 13, 2024
For LeftOuter/RightOuter and FullJoin the rootcause is the same. SMJ emits a null row if the filtered match is not found.
But if the filtered match row is found it should emit the joined row instead of null row. And here we come to the same issue as for LeftAnti, so we need to know when all the right rows processed for the given left row.
Given that SMJ emits rows in
freeze_streamedwhich can be called anytime once the output size is equal to batch size there is 2 possible options:comphead commentedon Nov 5, 2024
Related apache/datafusion-comet#398