fix: align array_has null buffer for scalar#17272
Merged
comphead merged 3 commits intoapache:mainfrom Aug 21, 2025
Merged
Conversation
alamb
approved these changes
Aug 21, 2025
| CREATE EXTERNAL TABLE array_has STORED AS PARQUET location 'test_files/scratch/array/array_has/single_file.parquet'; | ||
|
|
||
| query B | ||
| select array_contains(a, b) from array_has; |
Contributor
There was a problem hiding this comment.
This panics for me locally without the fix:
> select array_contains(a, b) from '/tmp/t.parquet';
thread 'main' panicked at /Users/andrewlamb/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/arrow-array-56.0.0/src/array/boolean_array.rs:91:13:
assertion `left == right` failed
left: 2
right: 1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Contributor
There was a problem hiding this comment.
I recommend we also test with array_contains (b, a) as well to covert the other argument order
Contributor
Author
There was a problem hiding this comment.
Sorry @alamb I'm not sure I'm following, the reverse order would violate array_has function signature.
Error during planning: Failed to coerce arguments to satisfy a call to 'array_has' function: coercion from [List(Field { name: "item", data_type: Boolean, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), List(Field { name: "item", data_type: List(Field { name: "item", data_type: Boolean, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} })] to the signature ArraySignature(Array { arguments: [Array, Element], array_coercion: Some(FixedSizedListToList) }) failed No function matches the given name and argument types 'array_has(List(Field { name: "item", data_type: Boolean, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), List(Field { name: "item", data_type: List(Field { name: "item", data_type: Boolean, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }))'. You might need to add explicit type casts.
Contributor
There was a problem hiding this comment.
Sorry -- I was just noticing in the code that it has two code paths when left and right are constants, but this query only exercises one of the paths, I think
comphead
added a commit
to comphead/arrow-datafusion
that referenced
this pull request
Aug 21, 2025
* fix: align `array_has` null buffer for scalar
alamb
pushed a commit
that referenced
this pull request
Aug 21, 2025
* fix: align `array_has` null buffer for scalar (#17272) * fix: align `array_has` null buffer for scalar * merge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
array_hasfails on null buffer union #17263 .Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?