Skip to content

GH-00000: [C++][Compute] Tighten case_when exact dispatch#80

Draft
zanmato1984 wants to merge 1 commit into
mainfrom
codex/case-when-parameterized-exact-dispatch
Draft

GH-00000: [C++][Compute] Tighten case_when exact dispatch#80
zanmato1984 wants to merge 1 commit into
mainfrom
codex/case-when-parameterized-exact-dispatch

Conversation

@zanmato1984

Copy link
Copy Markdown
Owner

Summary

case_when exact dispatch was too permissive for varargs kernels whose value arguments were registered by type id only.

This branch adds targeted reproducer coverage for mismatched parameterized value arguments and tightens the exact-dispatch match constraint so DispatchExact only accepts identical value types. DispatchBest still rewrites values to a common type first when coercion is intended.

Reproduced failure

Yes.

Before this patch, the new DispatchExactFails probes incorrectly succeeded for mismatched:

  • fixed_size_binary widths
  • list / fixed_size_list child shapes
  • struct field types
  • dictionary value types
  • dictionary index types

Root cause

case_when varargs kernels were registered with signatures based on value type id only. Decimal kernels had a special exact-match constraint, but other parameterized value types did not, so DispatchExact treated distinct parameterized types with the same type id as interchangeable.

Fix

Apply a shared exact-match constraint to case_when value args so all varargs exact dispatches require the same concrete value type.

Tests

  • extend TestCaseWhen.DispatchExact with targeted exact-match coverage for matching and mismatched parameterized value args
  • run ./debug/arrow-compute-scalar-if-else-test '--gtest_filter=TestCaseWhen.*'

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

❌ GitHub issue #00000 could not be retrieved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant