-
Notifications
You must be signed in to change notification settings - Fork 2k
fix: Return probe_side.len() for RightMark/Anti count(*) queries
#20710
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
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9f7e2ce
fix: Return `probe_side.len()` for RightMark/Anti count(*) queries
jonathanc-n 1f47c85
Merge branch 'main' into fix-right-joins-for-hj
jonathanc-n 486a400
fmt
jonathanc-n 0c2fe66
Merge branch 'fix-right-joins-for-hj' of https://github.com/jonathanc…
jonathanc-n acd5b0c
clippy
jonathanc-n 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5318,3 +5318,46 @@ DROP TABLE issue_20437_small; | |
|
|
||
| statement count 0 | ||
| DROP TABLE issue_20437_large; | ||
|
|
||
| # Test count(*) with right semi/anti joins returns correct row counts | ||
| # issue: https://github.com/apache/datafusion/issues/20669 | ||
|
|
||
| statement ok | ||
| CREATE TABLE t1 (k INT, v INT); | ||
|
|
||
| statement ok | ||
| CREATE TABLE t2 (k INT, v INT); | ||
|
|
||
| statement ok | ||
| INSERT INTO t1 SELECT i AS k, i AS v FROM generate_series(1, 100) t(i); | ||
|
|
||
| statement ok | ||
| INSERT INTO t2 VALUES (1, 1); | ||
|
|
||
| query I | ||
| WITH t AS ( | ||
| SELECT * | ||
| FROM t1 | ||
| LEFT ANTI JOIN t2 ON t1.k = t2.k | ||
| ) | ||
| SELECT count(*) | ||
| FROM t; | ||
| ---- | ||
| 99 | ||
|
|
||
| query I | ||
| WITH t AS ( | ||
| SELECT * | ||
| FROM t1 | ||
| LEFT SEMI JOIN t2 ON t1.k = t2.k | ||
| ) | ||
| SELECT count(*) | ||
| FROM t; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. double checked tests with duckDB, everything is fine |
||
| ---- | ||
| 1 | ||
|
|
||
| statement count 0 | ||
| DROP TABLE t1; | ||
|
|
||
| statement count 0 | ||
| DROP TABLE t2; | ||
Oops, something went wrong.
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.
should
RightMarkbe in the list?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 it becomes the same number of indices for both left + right indices. Refer to here