Uh oh!
There was an error while loading. Please reload this page.
fix length error with array_has - #12459
Conversation
samuelcolvin
left a comment
There was a problem hiding this comment.
@alamb I would love to get this merged, it's causing many queries that use ANY() to fail right now.
cc @jayzhan211 who I think wrote this.
| if values.len() == 0 { | ||
| return Ok(Arc::new(BooleanArray::from(vec![Some(false)]))); | ||
| return Ok(Arc::new(BooleanArray::new( | ||
| BooleanBuffer::new_unset(haystack.len()), |
There was a problem hiding this comment.
the point is that in this case the array returned should be the same length as the haystack, not 1.
alamb
left a comment
There was a problem hiding this comment.
Thank you for this fix @samuelcolvin -- I have one small nit pick about where the test should live, but we can also fix that as a follow on PR.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
7123862 to
b59daedCompareb59daed to
9c4b6c4CompareUh oh!
There was an error while loading. Please reload this page.
80906e8 to
16a6006Comparesamuelcolvin
commented
Sep 14, 2024
slt test updated and dedicated test removed. It would be great to get this merged. We'll run datafusion main until there's a another release since this is is affecting a lot of users as we migrate querying from timescale to datafusion. |
alamb
left a comment
There was a problem hiding this comment.
Thanks @jayzhan211 and @samuelcolvin
| # test empty arrays return length | ||
| # issue: https://github.com/apache/datafusion/pull/12459 | ||
| statement ok | ||
| create table values_all_empty (a int[]) as values ([]), ([]); |
samuelcolvin
commented
Sep 14, 2024
Thanks @alamb for merging so quickly. 🙏 |
alamb
commented
Sep 15, 2024
I try hard to prioritize bug fixes. Thank you for fixing the bug! |
Rationale for this change
Fixes an error we've been experiencing in prod where some queries that use
array_has(including viaANY()) result int:What changes are included in this PR?
Fix a bug in
array_haswhere it returned 1 row, instead of the size of the group.Are these changes tested?
Yes.
Are there any user-facing changes?
No.