zanmato1984 opened a new issue, #50624:
URL: https://github.com/apache/arrow/issues/50624
`case_when` should either find a valid common output type for its value
arguments or fail when the value types are incompatible.
On current `main`, some incompatible parameterized value types are
incorrectly accepted and the call returns successful but corrupted results
instead of failing.
I reproduced this on `origin/main` at `aa78eb8973` on macOS arm64
(AppleClang 17) on July 23, 2026.
Using `CallFunction("case_when", ...)`:
1. fixed_size_binary width mismatch
Input:
`case_when(cond=[true], left=["abcd"] as fixed_size_binary(4),
right=["efghi"] as fixed_size_binary(5))`
Actual:
`OK [fixed_size_binary[5]]: ["abcdi"]`
Expected:
The call should fail because the value argument types are incompatible.
2. list value type mismatch
Input:
`case_when(cond=[true], left=[[1, 2]] as list<int16>, right=[[3, 4]] as
list<int32>)`
Actual:
`OK [list<item: int32>]: [[131073, 0]]`
Expected:
The call should fail because the value argument types are incompatible.
3. fixed_size_list size mismatch
Input:
`case_when(cond=[true], left=[[1, 2]] as fixed_size_list<int32, 2>,
right=[[3, 4, 5]] as fixed_size_list<int32, 3>)`
Actual:
`OK [fixed_size_list<item: int32>[3]]: [[1, 2, 0]]`
Expected:
The call should fail because the value argument types are incompatible.
I also reproduced the same incorrect success for `struct<a: int32>` vs
`struct<a: int64>`.
This looks like another instance of the broader exact-dispatch problem
discussed in #47287, but here it affects `case_when` with incompatible
parameterized value types.
--
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]