Commit 757d355
fix: coerce rhs Arrow type to match lhs when comparing nested arrays
When arrow_compare_arrays falls back to make_comparator for nested
types (struct, list, etc.), both sides were independently converted to
Arrow with target=None, letting each array choose its own nearest
physical type. A struct child backed by VarBinArray would produce
Binary while a VarBinViewArray child would produce BinaryView. Both
represent the same logical DType::Binary, but the assert_eq! on the
data types panicked.
Fix: convert lhs first (target=None) then use its Arrow DataType as
the target Field when converting rhs. This mirrors the non-nested fast
path which uses Datum::try_new_with_target_datatype for the same
reason, and removes the now-redundant assert.
Add a regression test that directly reproduces the fuzz crash pattern:
a struct with a VarBinArray child on the left and a VarBinViewArray
child on the right.
Fixes #7957
Signed-off-by: Claude <claude@anthropic.com>
Co-authored-by: Joe Isaacs <joseph-isaacs@users.noreply.github.com>1 parent 2fa51e2 commit 757d355
1 file changed
Lines changed: 36 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
155 | 156 | | |
156 | 157 | | |
157 | 158 | | |
158 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
159 | 164 | | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
| 165 | + | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
512 | 540 | | |
513 | 541 | | |
514 | 542 | | |
| |||
0 commit comments