raushanprabhakar1 opened a new pull request, #22279: URL: https://github.com/apache/datafusion/pull/22279
## Which issue does this PR close? - Closes #22264. ## Rationale for this change PostgreSQL returns **NULL** for `array_length` on an empty dimension (e.g. `array_length(array[]::int[], 1)`). DataFusion returned **0**. This aligns semantics with PostgreSQL as requested in the issue. ## What changes are included in this PR? - `array_length` / `list_length`: return SQL **NULL** when the evaluated dimension slice is empty, instead of `0`. - Update `array/array_length.slt` expectations for empty arrays and add `array_length(ARRAY[]::INT[], 1)`. ## Are these changes tested? Yes. `cargo test --profile=ci --test sqllogictests -- array/array_length`. ## Are there any user-facing changes? Yes — observable SQL behavior: empty dimensions now yield **NULL** instead of **`0`** for `array_length` / `list_length`. Queries that depended on **`0`** may need **`IS NULL`** or **`COALESCE`**. -- 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]
