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

Fix Regex signature types #12690

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

blaginin
Copy link

@blaginin blaginin commented Sep 30, 2024

Which issue does this PR close?

Closes #12664.

Rationale for this change

As pointed out in the original issue, REGEX_MATCH and REGEX_LIKE fail if the first argument is LargeUtf8 but the second (or third) argument is Utf8. We were performing as_generic_string_array::<i64> on &GenericStringArray<i32>, which caused the issue.

What changes are included in this PR?

Regex Match implementation in Apache Arrow requires the input and patterns to have the same type, and the flags to have the same type as well. I have reflected this change in the function signatures.

Are these changes tested?

Yes, by string_query.slt.part

Are there any user-facing changes?

No, only a bugfix.

@github-actions github-actions bot added sqllogictest SQL Logic Tests (.slt) functions labels Sep 30, 2024
@goldmedal
Copy link
Contributor

Thanks @blaginin, for working on this! There are some TODO items related to this issue. Could you help address them?

You can test them using the following command

cargo test --test sqllogictests -- string/

@alamb
Copy link
Contributor

alamb commented Oct 1, 2024

Thank you @blaginin and @goldmedal for the review. Sounds like this PR is quite close ❤️

@blaginin
Copy link
Author

blaginin commented Oct 1, 2024

Thanks for the review, @goldmedal! I've uncommented your tests and also added flags testing. Quite a cool string test setup, by the way! ;)

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.

Looks great to me -- thank you @blaginin and @goldmedal 🏆

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

Successfully merging this pull request may close these issues.

REGEX_LIKE and REGEX_MATCH don't support LargeUtf8 type
3 participants