datafusion icon indicating copy to clipboard operation
datafusion copied to clipboard

[WIP] Make `Like` a top-level `Expr` and add SQL support for `ILike` and `SimilarTo`

Open andygrove opened this issue 3 years ago • 0 comments

Which issue does this PR close?

Closes https://github.com/apache/arrow-datafusion/issues/3099

Depends on https://github.com/sqlparser-rs/sqlparser-rs/pull/569

Rationale for this change

I would like to support queries using SIMILAR TO syntax in Postgres.

What changes are included in this PR?

This is a disruptive PR because we originally modeled LIKE and NOT LIKE as binary operations, which was a stretch. In Postgres, the LIKE, ILIKE, and SIMILAR TO expressions all accept an optional escape character, and we cannot model that naturally as a binary expression. For that reason, this PR moves LIKE from the binary Operator and makes it a top-level Expr.

Plumbing is also added for ILike and SimilarTo (known as RLike in some platforms) for case-insensitive and regular expression versions of Like.

Are there any user-facing changes?

Yes. This is an API change.

andygrove avatar Aug 10 '22 22:08 andygrove