-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace array_contains
with SQL array functions: array_has
, array_has_any
, array_has_all
#6990
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why I got these three files after regen.sh
proto_descriptor.bin
src/datafusion.rs serde.rs
@izveigor Did you have these three files when you run ./datafusion/proto/regen.sh
before?
@jayzhan211 Afrer all the calls the function |
concat_inner_lists(array_concat(&[as_list_array(&arg)? | ||
.values() | ||
.clone()])?) | ||
/// Array_has_any SQL function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not find a way that combines has_any
and has_all
without losing readability.
@jayzhan211 Nice features! Could you add documentation (files: |
array_has_any
, array_has_all
array_has_any
, array_has_all
array_has
, array_has_any
, array_has_all
, remove array_contains
array_has
, array_has_any
, array_has_all
, remove array_contains
array_contains
with SQL array functions: array_has
, array_has_any
, array_has_all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @jayzhan211
I think this PR looks good to me other than the panic's instead of errors. Once those are fixed I think this one is good to go.
Also, thank you to both you and @izveigor for pushing these functions ahead -- it is great to see DataFusion grow so nicely
non_list_contains!(array, args[1], BooleanArray) | ||
} | ||
_ => { | ||
todo!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please return DataFusionError::NotYetImplemented
here rather than todo!()
, which will panic?
.iter() | ||
.dedup() | ||
.flatten() | ||
.any(|x| x == elem.expect("null type not supported")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, can we please try and avoid panic's on not supported errors -- it makes for a much easier to understand error message for users
I think we should also update the user guide https://github.com/apache/arrow-datafusion/blob/main/docs/source/user-guide/sql/scalar_functions.md#array-functions as well to include these functions |
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks, @jayzhan211!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @jayzhan211 and @izveigor
Which issue does this PR close?
Ref #6980
Close #6973
Close #6976
Close #6977
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?