raghavyadav01 opened a new pull request, #27338:
URL: https://github.com/apache/datafusion/pull/27338

   ## Which issue does this PR close?
   
   - Closes #27223.
   
   ## Rationale for this change
   
   `array_concat` of a 2D and a 1D list wraps the 1D argument into a list. A 
NULL 1D row was wrapped into a list holding one NULL element, so `[[NULL, NULL, 
60]]` + NULL gave `[[NULL, NULL, 60], NULL]`, and an all-NULL row gave `[NULL]` 
or `NULL` depending on the other rows in its batch. As discussed in the issue, 
a NULL argument is now skipped, as it already is for 1D inputs and in Postgres 
`array_cat`.
   
   ## What changes are included in this PR?
   
   `align_array_dimensions` takes `keep_null_rows`. `array_concat` passes true, 
so a wrapped NULL row stays NULL and `concat_internal` skips it. `array_append` 
/ `array_prepend` pass false and keep adding a NULL element.
   
   ## Are these changes tested?
   
   Yes. The issue's repro in `array_concat.slt`, the updated 2D + 1D case, and 
a unit test for both modes with a sliced input. I also ran `array_concat.slt` 
at batch sizes 1–3: main gives different values, and with this change the only 
differences are row order.
   
   ## Are there any user-facing changes?
   
   `array_concat` of mixed-dimension lists no longer adds a NULL element for a 
NULL argument, and an all-NULL row returns NULL.
   
   AI-assisted. I reviewed every line and ran the tests above.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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]

Reply via email to