neilconway opened a new pull request, #20436:
URL: https://github.com/apache/datafusion/pull/20436

   ## Which issue does this PR close?
   
   - Closes #20434.
   
   ## Rationale for this change
   
   1. `concat_ws` returned `Utf8`, regardless of the input types it was called 
with. If it was called with `LargeUtf8`, returning `Utf8` might overflow. In 
general, functions like these should operate on all three string 
representations unless there is a compelling reason not to.
   4. `simplify_concat_ws` always constructed new literals with type `Utf8`. 
This lead to unnecessary casts when its inputs were of a different string type.
   
   ## What changes are included in this PR?
   
   * Support `concat_ws` return type matching its input types, following how 
`concat` does it.
   * In `simplify_concat_ws`, construct literals with the right type, not 
always `Utf8`
   * Refactor `return_type` for `concat` to be more readable
   * Add new unit and SLT tests
   * Update test output for changed types
   
   ## Are these changes tested?
   
   Yes.
   
   ## Are there any user-facing changes?
   
   Yes: some queries involving `concat_ws` will now omit unnecessary cast 
operations, and the return type of `concat_ws` might be any of the three string 
types. Generally these changes should match user expectations better than the 
previous behavior.


-- 
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]

Reply via email to