raghavyadav01 commented on code in PR #27338:
URL: https://github.com/apache/datafusion/pull/27338#discussion_r4554546728
##########
datafusion/functions-nested/src/concat.rs:
##########
Review Comment:
Yes, it follows the existing split. In both Postgres and DataFusion today,
concat skips a NULL argument and append adds it as an element:
- Postgres: `array_cat(ARRAY[1,2], NULL)` is `{1,2}`,
`array_append(ARRAY[1,2], NULL)` is `{1,2,NULL}`, and `array_cat(ARRAY[[1,2]],
NULL::int[])` is `{{1,2}}`.
- DataFusion main: `array_concat([1,2], NULL)` is `[1, 2]`,
`array_append([1,2], NULL)` is `[1, 2, NULL]`.
The bug was only in the mixed 2D + 1D path. The 1D argument gets wrapped to
2D before concat sees it, and a NULL row came out of that as a list holding one
NULL, so concat kept it instead of skipping it. `keep_null_rows` keeps the row
NULL for concat, so it is skipped like any other NULL argument. append and
prepend take the value as an element, so a NULL element is still what they
should add, and that path is unchanged.
--
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]