Skip to content

[Nested] Fix: 16489 - Find NULLs in lists using list_position#17080

Merged
Mytherin merged 17 commits intoduckdb:mainfrom
maiadegraaf:list_position_fix
May 7, 2025
Merged

[Nested] Fix: 16489 - Find NULLs in lists using list_position#17080
Mytherin merged 17 commits intoduckdb:mainfrom
maiadegraaf:list_position_fix

Conversation

@maiadegraaf
Copy link
Contributor

Previously, when calling list_position([1, 2, 3, NULL], NULL), the function would always return NULL instead of the index of the NULL element. This behavior differed from PostgreSQL. This PR fixes the issue, so that list_position now correctly returns the index of the element, regardless of whether or not it is NULL.

This PR builds on: #16969

Fixes: #16489

@duckdb-draftbot duckdb-draftbot marked this pull request as draft April 11, 2025 14:56
@maiadegraaf maiadegraaf marked this pull request as ready for review April 11, 2025 14:59
@duckdb-draftbot duckdb-draftbot marked this pull request as draft April 15, 2025 13:16
@maiadegraaf maiadegraaf marked this pull request as ready for review April 29, 2025 14:05
@duckdb-draftbot duckdb-draftbot marked this pull request as draft April 29, 2025 20:13
@maiadegraaf maiadegraaf marked this pull request as ready for review April 29, 2025 20:13
@maiadegraaf
Copy link
Contributor Author

Failing CI is unrelated.

@Mytherin Mytherin merged commit 541d3fe into duckdb:main May 7, 2025
49 of 51 checks passed
@Mytherin
Copy link
Collaborator

Mytherin commented May 7, 2025

Thanks!

krlmlr added a commit to duckdb/duckdb-r that referenced this pull request May 18, 2025
[Nested] Fix: 16489 - Find `NULL`s in lists using `list_position` (duckdb/duckdb#17080)
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request May 18, 2025
[Nested] Fix: 16489 - Find `NULL`s in lists using `list_position` (duckdb/duckdb#17080)
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request May 19, 2025
[Nested] Fix: 16489 - Find `NULL`s in lists using `list_position` (duckdb/duckdb#17080)
krlmlr added a commit to duckdb/duckdb-r that referenced this pull request May 19, 2025
[Nested] Fix: 16489 - Find `NULL`s in lists using `list_position` (duckdb/duckdb#17080)
@maiadegraaf maiadegraaf deleted the list_position_fix branch October 14, 2025 08:49
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.

"list_position" behaves differently from from postgres "array_position" for searching null values

4 participants