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

Proposal: Add similar to operator #3016

Closed
ayushdg opened this issue Aug 3, 2022 · 5 comments
Closed

Proposal: Add similar to operator #3016

ayushdg opened this issue Aug 3, 2022 · 5 comments
Assignees
Labels
enhancement New feature or request sql SQL Planner

Comments

@ayushdg
Copy link
Contributor

ayushdg commented Aug 3, 2022

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Add support for the SIMILAR TO operator like:

string SIMILAR TO pattern [ESCAPE escape-character]
string NOT SIMILAR TO pattern [ESCAPE escape-character]

(This section helps Arrow developers understand the context and why for this feature, in addition to the what)

Describe the solution you'd like
Support this sql syntax where currently users would see a parser error Expected end of statement, found: SIMILAR

Describe alternatives you've considered
There is some overlap between the LIKE operator and SIMILAR though the regex interpretation might be slightly different.

Additional context
Syntax from the postgresql documentation: https://www.postgresql.org/docs/current/functions-matching.html.
Came up while working on tests in the dask-sql project.

@ayushdg ayushdg added the enhancement New feature or request label Aug 3, 2022
@ayushdg ayushdg changed the title Proposal: Add SIMILAR TO operator Proposal: Add similar to operator Aug 3, 2022
@alamb
Copy link
Contributor

alamb commented Aug 3, 2022

Seems reasonable to me

@andygrove andygrove added the sql SQL Planner label Aug 3, 2022
@liukun4515
Copy link
Contributor

Nice feature for datafusion core.
Do you have a plan to implement it?
@ayushdg

@andygrove andygrove self-assigned this Aug 4, 2022
@andygrove
Copy link
Member

I am planning on implementing this but also happy if anyone else wants to pick it up

@alamb
Copy link
Contributor

alamb commented Aug 15, 2022

sqlparser support was added here: apache/datafusion-sqlparser-rs#569

I'll try and get a new release of that library out in a day or two

@andygrove
Copy link
Member

This is now being tracked in #3099

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request sql SQL Planner
Projects
None yet
Development

No branches or pull requests

4 participants