neilconway opened a new pull request, #22046: URL: https://github.com/apache/datafusion/pull/22046
## Which issue does this PR close? - Closes #22044. - Closes #22045. ## Rationale for this change `overlay` mixed up character-based and byte-based indexing, which resulted in either panicking or returning incorrect results on multi-byte Unicode input. While looking at this, I also fixed a few places where `overlay`'s behavior was inconsistent with Postgres and the SQL spec, refactored the code, and added a benchmark. ## What changes are included in this PR? * Fix panic or wrong results on multibyte Unicode input * Align edge-case behavior with Postgres: start past end appends replacement after the full input, `start <= 0` errors * Refactored the code to reduce redundancy and clarify variable names * Add SLT tests for Unicode input and behavior changes for Postgres compatibility * Add benchmark, in advance of subsequent performance optimization work ## Are these changes tested? Yes, and new tests added. ## Are there any user-facing changes? Yes. The behavior of `overlay` has changed for multibyte Unicode inputs, as well as the edge cases enumerated above. -- 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]
