Tim-53 opened a new pull request, #20659: URL: https://github.com/apache/datafusion/pull/20659
## Which issue does this PR close? Part of https://github.com/apache/datafusion/issues/20585 ## Rationale for this change `lpad` was returning `Utf8` when given `Utf8View` inputs, causing unnecessary type casting downstream ## What changes are included in this PR? - Fix return_type to preserve `Utf8View` when the input is `Utf8View` - Introduce `StringArrayWriter` trait in unicode/common.rs to abstract over `GenericStringBuilder` and `StringViewBuilder`, allowing `lpad` to produce the correct output type - Add tests covering Utf8View return type and value correctness in `string_view.slt` ## Are these changes tested? Yes new unit tests were added to cover all input/fill combinations. Slt tests were added to verify the return type is preserved for `Utf8View` inputs ## Are there any user-facing changes? `lpad` now correctly returns `Utf8View` when given `Utf8View` input. Note: `rpad` has the same issue and will be addressed in a follow-up. -- 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]
