linuxpi opened a new pull request, #26073: URL: https://github.com/apache/datafusion/pull/26073
## Which issue does this PR close? - Closes #26072. ## Rationale for this change On a zero-row `List<Utf8>` (or other non-primitive element type), `array_min` / `array_max` fail with `Empty iterator passed to ScalarValue::iter_to_array`. `ProjectionExec` and `TopK` evaluate expressions on empty batches, so the query fails instead of returning no rows. ## What changes are included in this PR? - `array_min_max_helper` returns `new_empty_array(&array.value_type())` for an empty input before the `ScalarValue` fallback. The primitive fast path is unchanged. - First unit tests for `min_max.rs`: zero-row `List`/`LargeList<Utf8>`, zero-row `List<Int64>`, mixed rows, and `invoke_with_args` with `number_rows: 0`. ## Are these changes tested? Yes. Without the fix, the zero-row `Utf8` tests fail with the error above. ## 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
