hcrosse opened a new issue, #21703:
URL: https://github.com/apache/datafusion/issues/21703

   ### Describe the bug
   
   `concat_ws(sep, array, array, ...)` dispatches to the string `concat_ws` 
UDF, which coerces the array arguments to their string representation and joins 
them textually. For example:
   
   ```sql
   select concat_ws(',', make_array(1, 2, 3), make_array(4, 5));
   ```
   
   returns `[1, 2, 3],[4, 5]` instead of either rejecting the call as a type 
error or producing well-defined array semantics.
   
   This is the same class of bug as #18020. Filing separately because the right 
fix is less obvious as `concat_ws` doesn't have a direct array equivalent the 
way `concat` maps to `array_concat`, so "reject with a plan error" may be the 
better answer here.
   
   ### To Reproduce
   
   ```sql
   select concat_ws(',', make_array(1, 2, 3), make_array(4, 5));
   -- returns: [1, 2, 3],[4, 5]
   ```
   
   ### Expected behavior
   
   Either a plan error rejecting array arguments, or well-defined array 
semantics, not silent stringification.
   
   ### Additional context
   
   Noticed by @neilconway while reviewing #21689.


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