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

support cast/try_cast expr in reduceOuterJoin #3621

Merged
merged 2 commits into from
Sep 29, 2022

Conversation

HuSen8891
Copy link
Contributor

Which issue does this PR close?

Closes #3565

Rationale for this change

ReduceOuterJoin optimizer support cast or try_cast exprs in predicate.

for query:
select * from t1 left join t2 on t1.t1_id = t2.t2_id where cast(t2.t2_id as int64) < Int64(100);

which contains cast or try_cast expr in where clause,can also be transformed to inner join

select * from t1 inner join t2 on t1.t1_id = t2.t2_id where cast(t2.t2_id as int64) < Int64(100);

@github-actions github-actions bot added the optimizer Optimizer rules label Sep 26, 2022
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thanks @AssHero

@@ -438,13 +449,13 @@ mod tests {
None,
)?
.filter(binary_expr(
col("t1.b").gt(lit(10u32)),
cast(col("t1.b"), DataType::Int64).gt(lit(10u32)),
Copy link
Contributor

Choose a reason for hiding this comment

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

I recommend adding a new test explicitly for the cast case (or at least renaming the test) rather than modifying the existing one so it is clear that the case is covered

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll add some new test cases laster. Thanks!

Copy link
Contributor

@liukun4515 liukun4515 left a comment

Choose a reason for hiding this comment

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

@AssHero Thanks
LGTM

@liukun4515 liukun4515 merged commit 9af2337 into apache:master Sep 29, 2022
@ursabot
Copy link

ursabot commented Sep 29, 2022

Benchmark runs are scheduled for baseline = 06a4f79 and contender = 9af2337. 9af2337 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

@HuSen8891 HuSen8891 deleted the enhance_reduce_outer_join branch October 17, 2022 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimizer Optimizer rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ReduceOuterJoin optimizer support cast or try_cast expr.
4 participants