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

Add regexp_extract func #14282

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

Add regexp_extract func #14282

wants to merge 2 commits into from

Conversation

SKY-ALIN
Copy link

Which issue does this PR close?

Closes #14280.

Rationale for this change

Adding more functions

What changes are included in this PR?

The implementation of regexp_extract based on Spark regexp_extract

Are these changes tested?

Yes

Are there any user-facing changes?

No

@github-actions github-actions bot added documentation Improvements or additions to documentation sqllogictest SQL Logic Tests (.slt) functions labels Jan 24, 2025
}

fn regexp_extract<T: OffsetSizeTrait>(args: &[ArrayRef]) -> Result<ArrayRef> {
let target = as_generic_string_array::<T>(&args[0])?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd have to check but I don't think this would work with DataType::Utf8View. Could some sql tests be added that cover all the possible input types?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added one more sql test and according to its result it works

@Omega359
Copy link
Contributor

Thanks for your contribution! I've left some comments for your review.

@SKY-ALIN SKY-ALIN requested a review from Omega359 January 25, 2025 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation functions sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

regexp_extract func from Spark
2 participants