kosiew opened a new pull request, #22166: URL: https://github.com/apache/datafusion/pull/22166
## Which issue does this PR close? * Part of #22163 ## Rationale for this change The `%c` conversion path in Spark `format_string` duplicated nearly identical logic across all signed and unsigned integer scalar variants. This duplication increased maintenance overhead and the risk of future `%c` fixes being applied inconsistently. This change centralizes numeric scalar-to-character conversion in a single helper while preserving existing behavior and error propagation semantics. ## What changes are included in this PR? * Added a local `integer_scalar_to_char` helper to centralize integer scalar `%c` conversion handling. * Routed all non-null integer `%c` conversion paths through the new helper. * Removed duplicated `%c` conversion branches from individual integer scalar match arms. * Preserved existing signed/unsigned conversion semantics by continuing to use the existing `signed_to_char` and `unsigned_to_char` helpers. * Left all non-`%c` formatting behavior unchanged. ## Are these changes tested? No new tests were added in this PR. This refactor is intended to preserve existing behavior, and existing `%c` formatting tests continue to validate valid and invalid code point handling. Suggested validation command: ```bash cargo test -p datafusion-spark format_char ``` ## Are there any user-facing changes? No. This is a maintainability refactor only and is not intended to change observable behavior or error messages. ## LLM-generated code disclosure This PR includes LLM-generated code and comments. All LLM-generated content has been manually reviewed and tested. -- 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]
