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 for SIMILAR TO for physical plan #12350

Merged
merged 4 commits into from
Sep 9, 2024
Merged

Conversation

theirix
Copy link
Contributor

@theirix theirix commented Sep 5, 2024

Which issue does this PR close?

Add support for SIMILAR TO and NOT SIMILAR TO to the physical plan.

Closes #12155.

Rationale for this change

Currently, a simple query select * from t1 where c1 similar to 'x*' is not supported.

What changes are included in this PR?

  • Support for "SIMILAR TO" family operator in physical plan
  • Additional sqllogic tests

The functionality is based on creating a binary expression for Operator::RegexMatch and family.

There is an existing like module for the LIKE operator. Probably, this functionality can be extracted to a similar similar_to module.

Are these changes tested?

  • unit test (for binary operator only)
  • sqllogictest integration test
  • manual test using datafusion-cli
  • tested with additional operators for expression and pattern

Are there any user-facing changes?

No

@github-actions github-actions bot added physical-expr Physical Expressions sqllogictest SQL Logic Tests (.slt) labels Sep 5, 2024
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 @theirix -- this PR looks good to me

@alamb
Copy link
Contributor

alamb commented Sep 6, 2024

There is an existing like module for the LIKE operator. Probably, this functionality can be extracted to a similar similar_to module.

Perhaps you could do this as a follow on PR

@alamb alamb merged commit 9001b73 into apache:main Sep 9, 2024
24 checks passed
@alamb
Copy link
Contributor

alamb commented Sep 9, 2024

Thanks again @theirix

@theirix
Copy link
Contributor Author

theirix commented Sep 9, 2024

Thanks again @theirix

Sure! It allowed me to better understand the datafusion internals

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
physical-expr Physical Expressions sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

not support similar to expr run in physical expr?
2 participants