Skip to content

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 Changes to the physical-expr crates 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
@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 Changes to the physical-expr crates 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