neilconway commented on PR #21980:
URL: https://github.com/apache/datafusion/pull/21980#issuecomment-4366173666
> > FYI I think there's an opportunity to refactor this into an extension to
the StringViewArrayBuilder API we just added (and perhaps use it in some other
string UDFs), but I'd like to land this change first, so we can be sure the
refactoring doesn't regress codegen.
>
> Do you mean for special case ASCII strings?
I meant something similar to what you suggested in the PR -- for example, a
function like:
```rust
impl StringViewArrayBuilder {
/// Reserve `len` bytes of output storage and let the caller fill them.
pub fn append_with<F: FnOnce(&mut [u8])>(&mut self, len: usize, fill:
F);
}
```
We could use that in `reverse`, `translate`, `initcap`, and `lower`/`upper`.
I want to check whether it regresses performance against the hand-optimized
version though.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]