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

Implement native support StringView for REPEAT #11962

Merged
merged 3 commits into from
Aug 14, 2024

Conversation

tlm365
Copy link
Contributor

@tlm365 tlm365 commented Aug 13, 2024

Which issue does this PR close?

Closes #11914 and part of #11790.

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

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 very much @tlm365 -- this is a very nice first contribution 🏅

Ok(Arc::new(result) as ArrayRef)
}

fn repeat_common(string: Option<&str>, number: Option<i64>) -> Option<String> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you could make this perform much better by avoiding the String and instead building the output directly with StringViewBuilder

https://docs.rs/arrow/latest/arrow/array/type.StringViewBuilder.html

here is an example of how to use them: apache/arrow-rs#6240

I realize this just follows the same model as was here. However, if we are messing with the code it might be nice to make it faster while we are at it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alamb thanks so much for reviewing. I will take a look!

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you -- I filed #11990 to track the idea

@alamb
Copy link
Contributor

alamb commented Aug 14, 2024

I took the liberty of merging up from main and running cargo fmt on this PR

@alamb alamb merged commit f98f8a9 into apache:main Aug 14, 2024
24 checks passed
@tlm365 tlm365 deleted the utf8view-repeat branch August 21, 2024 07:28
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.

Update REPEAT scalar function to support Utf8View
2 participants