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

remove Operator::{Like,NotLike,ILike,NotILike} #4792

Merged
merged 2 commits into from
Jan 5, 2023

Conversation

unconsolable
Copy link
Contributor

Which issue does this PR close?

Closes #4765 .

Rationale for this change

See issue.

What changes are included in this PR?

  • Remove Operator::{Like,NotLike,ILike,NotILike}
  • For datafusion_expr::expr::Expr::{like, not_like, ilike, not_ilike}, return Expr::{Like, ILike} version.
  • In TypeCoercionRewriter use like_coercion directly, bypass Operator::Like etc.
  • Add a new LikeExpr in datafusion_physical_expr::expressions, bypass Operator::Like etc. Also convert Expr::{like, not_like, ilike, not_ilike} to this LikeExpr
  • Add new type in PhysicalExprNode proto, make corresponding change in from_proto & to_proto

Are these changes tested?

  • TypeCoercionRewriter and LikeExpr are tested correspondingly.
  • In datafusion::physical_plan::planner::tests::errors(), tests for like/ilike/not like/not ilike are removed, as for Expr::Like and Expr::ILike, coerce_types are not performed in Expr::get_type

https://github.com/apache/arrow-datafusion/blob/54ae4323a730a4a34c6b5f638e2083f0c3fe5dcc/datafusion/expr/src/expr_schema.rs#L128-L130

Are there any user-facing changes?

No.

@github-actions github-actions bot added core Core DataFusion crate logical-expr Logical plan and expressions optimizer Optimizer rules physical-expr Physical Expressions labels Jan 2, 2023
@alamb
Copy link
Contributor

alamb commented Jan 2, 2023

Thank you 🙏 @unconsolable -- I plan to review this one carefully tomorrow

@alamb alamb added the api change Changes the API exposed to users of the crate label Jan 2, 2023
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.

Thank you @unconsolable -- this is a very beautiful first PR 🏆

I had a few minor suggestions but overall this looks very close to mergable.

Thank you so much 🙏

datafusion/expr/src/type_coercion/binary.rs Outdated Show resolved Hide resolved
datafusion/optimizer/src/type_coercion.rs Outdated Show resolved Hide resolved
datafusion/optimizer/src/type_coercion.rs Outdated Show resolved Hide resolved
datafusion/optimizer/src/type_coercion.rs Outdated Show resolved Hide resolved
datafusion/physical-expr/src/expressions/like.rs Outdated Show resolved Hide resolved
datafusion/physical-expr/src/expressions/like.rs Outdated Show resolved Hide resolved
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.

Thank you @unconsolable and @crepererum

@alamb alamb merged commit 702e117 into apache:master Jan 5, 2023
@alamb
Copy link
Contributor

alamb commented Jan 5, 2023

🚀

@ursabot
Copy link

ursabot commented Jan 5, 2023

Benchmark runs are scheduled for baseline = 24023b5 and contender = 702e117. 702e117 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api change Changes the API exposed to users of the crate core Core DataFusion crate logical-expr Logical plan and expressions optimizer Optimizer rules physical-expr Physical Expressions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple ways to express like / ilike / not like / not ilike
4 participants