Repository navigation
perf: speed up INTERSECT ALL and EXCEPT ALL on mostly distinct rows #25767
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
Open
1fanwang
wants to merge
22
commits into
apache:main
Choose a base branch
from
1fanwang:1fannnw/set-operation-grouped-count
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,527
−69
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
2a542b3
fix: preserve duplicate counts in set operations
1fanwang 92e52a7
fix: share multiset set operation planning across APIs
1fanwang 09c4eaa
Merge current main and preserve Substrait nullability
1fanwang a03258c
fix: keep input qualifiers in INTERSECT ALL and EXCEPT ALL
1fanwang 145bee4
docs: note the row_number requirement for INTERSECT ALL and EXCEPT ALL
1fanwang 84ef8f7
test: cover INTERSECT ALL and EXCEPT ALL duplicate counts
1fanwang c765112
perf: plan INTERSECT ALL and EXCEPT ALL with grouped counts
1fanwang 35fbc65
Merge upstream/main into 1fanwang-fix-set-operation-duplicates
1fanwang c42d494
Merge 1fanwang-fix-set-operation-duplicates into 1fannnw/set-operatio…
1fanwang 08c3e79
Merge upstream/main into 1fanwang-fix-set-operation-duplicates
1fanwang 1830174
Merge latest main and resolve set operation conflicts
1fanwang 77e67eb
Merge origin/main into 1fanwang-fix-set-operation-duplicates
1fanwang 9e378c6
Merge parent set-operation correctness fixes
1fanwang 3372b2b
Merge latest main
1fanwang 1f95f9a
Merge branch 'main' into 1fannnw/set-operation-grouped-count
kosiew bc0acb6
fix: count INTERSECT ALL and EXCEPT ALL rows in the type they are com…
1fanwang 7bed929
test: cover empty inputs for INTERSECT ALL and EXCEPT ALL
1fanwang 4dc0cdd
docs: note that INTERSECT ALL and EXCEPT ALL plans cannot be exported…
1fanwang 05add91
Merge remote-tracking branch 'origin/main' into 1fanwang/25767-review…
1fanwang 9025f82
fix: use built-in functions for set operations
1fanwang 9143f50
test: gate set operation test on SQL feature
1fanwang 45dbfe4
Merge latest main into set-operation review fixes
1fanwang 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 |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| #![cfg(all(feature = "sql", not(feature = "nested_expressions")))] | ||
|
|
||
| use datafusion::prelude::SessionContext; | ||
|
|
||
| #[tokio::test] | ||
| async fn set_operations_require_nested_expressions() -> datafusion::error::Result<()> { | ||
| let ctx = SessionContext::new(); | ||
| let err = ctx | ||
| .sql("SELECT 1 INTERSECT ALL SELECT 1") | ||
| .await | ||
| .unwrap_err(); | ||
| assert!( | ||
| err.to_string() | ||
| .contains("built-in count and range functions to be available"), | ||
| "{err}" | ||
| ); | ||
|
|
||
| let dataframe = ctx.sql("SELECT 1").await?; | ||
| let err = dataframe.clone().intersect(dataframe).unwrap_err(); | ||
| assert!( | ||
| err.to_string() | ||
| .contains("built-in count and range functions to be available"), | ||
| "{err}" | ||
| ); | ||
| Ok(()) | ||
| } |
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
Oops, something went wrong.
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.
I think this is a bad idea -- we should not have the session state depending on aggregate functions