Skip to content

Conversation

@Lordworms
Copy link
Contributor

Which issue does this PR close?

Closes #11997

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@Lordworms
Copy link
Contributor Author

Lordworms commented Aug 20, 2024

Sorry for the late update, got some personal issue last week

@github-actions github-actions bot added the functions Changes to functions implementation label Aug 20, 2024
@Omega359
Copy link
Contributor

lgtm

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.

Likewise this looks good to me -- thank you @Lordworms

We just need to sort out the cargo fmt CI Error

maybe we could make two separate macros? Or use StringArrayType to make generic functions instead -- see #12027

@Lordworms
Copy link
Contributor Author

Sure

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.

Awesome -- very nice @Lordworms

Thank you for the review and help @Omega359

let length = if length < 0 { 0 } else { length as usize };
let graphemes = string.graphemes(true).collect::<Vec<&str>>();
let fill_chars = fill.chars().collect::<Vec<char>>();
pub fn rpad<StringArrayLen: OffsetSizeTrait, FillArrayLen: OffsetSizeTrait>(
Copy link
Contributor

Choose a reason for hiding this comment

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

😍 -- 100% for no more macros!

@alamb alamb merged commit 7eeac2f into apache:main Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

functions Changes to functions implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Speed up rpad implementation to use StringBuilder

3 participants