waterWang opened a new pull request, #24350: URL: https://github.com/apache/datafusion/pull/24350
## Which issue does this PR close? Closes #24347. ## Rationale for this change `array_append`, `array_prepend`, `array_replace`, `array_replace_n`, and `array_replace_all` have the same defect that #24341 describes for `array_slice`: `return_type` promises the input list type verbatim (inner field name, nullability, and metadata included), but the kernel rebuilds the output's inner field from scratch with `Field::new_list_field(..., true)`. The promise sites return `Ok(array_type.clone())` / `Ok(args[0].clone())`, but the kernels create a new `Field::new_list_field(value_type, true)` — discarding the input's inner field. ## What changes are included in this PR? Fix the payload sites (concat_internal, generic_append_and_prepend, general_replace, general_replace_with_scalar) to preserve the input list's inner field: - **concat.rs**: `concat_internal` at line 445 and `generic_append_and_prepend` at line 568 now extract the field from the input list's `DataType` instead of creating a new default field. - **replace.rs**: `general_replace` at line 505 and `general_replace_with_scalar` at line 601 now preserve the input list's field. ## Are these changes tested? Existing tests cover the functionality. The fix follows the same pattern as #24343 (array_slice). No new tests added — the existing test suite exercises the same code paths. ## Are there any user-facing changes? No. The bug is only observable on debug builds (return-type assertion from #17515) or when a downstream consumer inspects the inner field's name/nullability/metadata. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
