zanmato1984 opened a new pull request, #50625: URL: https://github.com/apache/arrow/pull/50625
### Rationale for this change `case_when` exact dispatch was too permissive for parameterized value types. When the value arguments were registered by type id only, `DispatchExact` could incorrectly accept incompatible concrete types and return successful but corrupted results instead of failing or falling back to `DispatchBest`. This fixes #50624. ### What changes are included in this PR? - rename the case_when exact-match helper to `AllValueTypesMatchConstraint()` to make its intent explicit - apply the same exact-match constraint across case_when value kernels so exact dispatch only accepts identical value `DataType`s - add regression coverage for mismatched parameterized value types, including `fixed_size_binary`, `list`, `fixed_size_list`, `struct`, and dictionary exact-dispatch mismatches ### Are these changes tested? Yes. This PR extends `TestCaseWhen.DispatchExact` and adds `TestCaseWhen.ParameterizedValueTypeMismatch`. I also ran targeted `arrow-compute-scalar-if-else-test` coverage for: - `TestCaseWhen.DispatchExact` - `TestCaseWhen.DispatchBest` - `TestCaseWhen.ParameterizedValueTypeMismatch` ### Are there any user-facing changes? Yes. `case_when` now rejects incompatible parameterized value types that previously could be incorrectly exact-dispatched, which could lead to corrupted results. **This PR contains a "Critical Fix".** It fixes a bug where `case_when` could return successful but corrupted results for incompatible parameterized value types. * GitHub Issue: #50624 -- 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]
