alamb opened a new pull request, #10099:
URL: https://github.com/apache/arrow-rs/pull/10099
# Which issue does this PR close?
N/A — test-only coverage improvement.
# Rationale for this change
While reviewing #10025 (which adds a primitive-child fast path to
`interleave_list`), I noticed `interleave` over list arrays had no test for a
primitive child that carries logical type parameters —
`Decimal128`/`Decimal256` precision & scale, or timezone-aware `Timestamp`.
This matters because a list's child `PrimitiveArray` must be reconstructed
with `field.data_type()` (e.g. `Decimal128(20, 3)`, `Timestamp(Microsecond,
Some("+08:00"))`), not the default (`Decimal128(38, 10)` / no timezone). If the
interleaved child were built with the default type, `GenericListArray::new`
would panic with a data-type mismatch. There was no regression test guarding
that, on `main` or in #10025.
# What changes are included in this PR?
Two new tests in `arrow-select/src/interleave.rs`, each parameterized over
`i32`/`i64` offsets:
- `test_lists_decimal` — `List<Decimal128(20, 3)>` with child-element nulls;
asserts values, nulls, and that the interleaved child preserves `Decimal128(20,
3)`.
- `test_lists_timestamp_tz` — `List<Timestamp(Microsecond, "+08:00")>`;
asserts the timezone is preserved on the interleaved child.
# Are these changes tested?
This PR is the tests. They pass on `main`, and also guard the fast path
added in #10025.
# Are there any user-facing changes?
No.
--
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]