Skip to content

[branch-52] Cherry-pick apache/datafusion#20533#96

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit intoDataDog:branch-52from
dd-david-levin:david.levin/cherry-pick/apache-pr-20533-20260325
Mar 26, 2026
Merged

[branch-52] Cherry-pick apache/datafusion#20533#96
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit intoDataDog:branch-52from
dd-david-levin:david.levin/cherry-pick/apache-pr-20533-20260325

Conversation

@dd-david-levin
Copy link
Copy Markdown

@dd-david-levin dd-david-levin commented Mar 25, 2026

cherry-picks apache#20533

necessary to cherry pick in #95 which has a fix for string_to_array

## Which issue does this PR close?

- Closes apache#20526.

## Rationale for this change

Per Postgres and the SQL spec, `cardinality()` of an empty array should
be zero; we previously returned `NULL`.

Along the way, fix another bug: we previously returned `0` for the
cardinality of an untyped `NULL` and `NULL` for the cardinality of a
typed null (e.g., `NULL::int[]`). We should return `NULL` in both cases.

## What changes are included in this PR?

Bug fixes, update SLT.

## Are these changes tested?

Yes.

## Are there any user-facing changes?

Yes: the behavior of `cardinality` has changed, albeit the previous
behavior was incorrect.

(cherry picked from commit e684994)
@dd-david-levin dd-david-levin force-pushed the david.levin/cherry-pick/apache-pr-20533-20260325 branch from 41f238b to 201c016 Compare March 26, 2026 14:53
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit 8498635 into DataDog:branch-52 Mar 26, 2026
30 checks passed
@gabotechs gabotechs changed the title Cherry-pick apache/datafusion#20533 [branch-52] Cherry-pick apache/datafusion#20533 Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants