vibhuthespeedst opened a new pull request, #27840: URL: https://github.com/apache/datafusion/pull/27840
## Which issue does this PR close? - Closes #25224. ## Rationale for this change A NULL inner list can still point at real values through its offsets. `flatten` only reads the offsets, so those values showed up in the result. For example, `[[9], NULL]` where the NULL entry still covers `[1, 2, 3]` gave `[9, 1, 2, 3]` instead of `[9]`. ## What changes are included in this PR? Added `empty_null_ranges` in `flatten.rs`. Before flattening, it rebuilds the inner list so NULL entries cover no values. If no NULL entry hides any values, the list is used as is, so the normal case copies nothing. ## Are these changes tested? Yes. A unit test in `flatten.rs`, and the three queries from the issue in `array_cast.slt`. ## Are there any user-facing changes? `flatten` no longer returns values from NULL inner lists. -- 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]
