-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Improve lpad udf by using a GenericStringBuilder #11987
Conversation
…ure/lpad_utf8view
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me -- thank you @Omega359
group.bench_function(BenchmarkId::new("largeutf8 type", size), |b| { | ||
b.iter(|| criterion::black_box(rpad().invoke(&args).unwrap())) | ||
}); | ||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason to leave this commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rpad update with utf8view wasn't committed yet. I know it would work anyways but I think now that rpad update is committed it's good to uncomment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can make a follow on PR with cleaning up rpad and applying the same pattern. I filed #11997 to track that idea
return exec_err!("lpad requested length {length} too large"); | ||
} | ||
let array = if fill_array.is_none() { | ||
let mut builder: GenericStringBuilder<T> = GenericStringBuilder::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Which issue does this PR close?
Closes #11984
Rationale for this change
Code cleanup, performance improvement.
What changes are included in this PR?
Code, benchmark.
Are these changes tested?
Yes
Are there any user-facing changes?
No