Repository navigation
Commit 390d210
authored
Preserve list element metadata when rebuilding scalar values (#26092)
## Summary
`ScalarValue::cast_to` reconstructs LIST values through
`SingleRowListArrayBuilder::with_field`. That builder copied the child
field name and nullability but dropped its metadata. Casting a LIST to a
target field containing nested metadata (for example an Iceberg
`PARQUET:field_id`) therefore produced a scalar with a different type
from the requested target, and subsequent batch expansion could fail
schema validation.
Copy the field metadata as well. This only runs when constructing a
scalar LIST; columnar cast and batch fast paths are unchanged.
## Validation
- New regression test covers LIST scalar cast to a metadata-bearing
element field and batch expansion.
- `cargo +1.95.0 test --offline -p datafusion-common --lib`: 624 passed.
- `cargo +1.95.0 fmt --all --check`: passed.
- Independent read-only review: approved, no blocking findings.1 parent 7d4893c commit 390d210
1 file changed
Lines changed: 26 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
| 564 | + | |
564 | 565 | | |
565 | 566 | | |
566 | 567 | | |
| |||
570 | 571 | | |
571 | 572 | | |
572 | 573 | | |
| 574 | + | |
573 | 575 | | |
574 | 576 | | |
575 | 577 | | |
| |||
585 | 587 | | |
586 | 588 | | |
587 | 589 | | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
592 | 596 | | |
593 | 597 | | |
594 | 598 | | |
| |||
661 | 665 | | |
662 | 666 | | |
663 | 667 | | |
| 668 | + | |
664 | 669 | | |
665 | 670 | | |
666 | 671 | | |
667 | 672 | | |
668 | 673 | | |
669 | 674 | | |
670 | | - | |
| 675 | + | |
671 | 676 | | |
672 | 677 | | |
673 | 678 | | |
| |||
1610 | 1615 | | |
1611 | 1616 | | |
1612 | 1617 | | |
| 1618 | + | |
1613 | 1619 | | |
1614 | 1620 | | |
1615 | 1621 | | |
| |||
1621 | 1627 | | |
1622 | 1628 | | |
1623 | 1629 | | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
1624 | 1644 | | |
1625 | 1645 | | |
1626 | 1646 | | |
| |||
0 commit comments