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:
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
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.
Describe the bug
concat_ws(sep, array, array, ...)dispatches to the stringconcat_wsUDF, which coerces the array arguments to their string representation and joins them textually. For example: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_wsdoesn't have a direct array equivalent the wayconcatmaps toarray_concat, so "reject with a plan error" may be the better answer here.To Reproduce
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.