Skip to content
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

MINOR: Improvements to scalar_subquery_to_join error handling #3754

Merged
merged 3 commits into from
Oct 7, 2022

Conversation

andygrove
Copy link
Member

Which issue does this PR close?

N/A

Rationale for this change

The rule scalar_subquery_to_join converts certain types of qualifying scalar subqueries into joins. When it encounters a subquery that is not possible to convert to a join then it currently fails with an error. It would be better for it to ignore subqueries that are not applicable to this rule.

What changes are included in this PR?

Stop failing with an error on scalar subqueries that cannot be converted into joins.

Are there any user-facing changes?

@andygrove andygrove marked this pull request as draft October 7, 2022 14:21
@andygrove
Copy link
Member Author

@avantgardnerio Could you review this when you get a chance

@andygrove andygrove marked this pull request as ready for review October 7, 2022 14:55
@@ -21,7 +21,7 @@ use crate::utils::{
};
use crate::{utils, OptimizerConfig, OptimizerRule};
use datafusion_common::{context, plan_err, Column, Result};
use datafusion_expr::logical_plan::{Aggregate, Filter, JoinType, Projection, Subquery};
use datafusion_expr::logical_plan::{Filter, JoinType, Limit, Subquery};
use datafusion_expr::{combine_filters, Expr, LogicalPlan, LogicalPlanBuilder, Operator};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea here is that if the particular subquery isn't supported by the physical operators, it will error out at that time?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea here is that if the particular subquery isn't supported by the physical operators, it will error out at that time?

Yes, exactly.

@alamb alamb merged commit 1d634e5 into apache:master Oct 7, 2022
@ursabot
Copy link

ursabot commented Oct 7, 2022

Benchmark runs are scheduled for baseline = 4dd4d43 and contender = 1d634e5. 1d634e5 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-datafusion-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@andygrove andygrove deleted the scalar-subquery-improvements branch January 27, 2023 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants