Replace array_contains with SQL array functions: array_has, array_has_any, array_has_all#6990
Replace array_contains with SQL array functions: array_has, array_has_any, array_has_all#6990alamb merged 17 commits intoapache:mainfrom
array_contains with SQL array functions: array_has, array_has_any, array_has_all#6990Conversation
There was a problem hiding this comment.
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.
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_allarray_has, array_has_any, array_has_all, remove array_contains
array_has, array_has_any, array_has_all, remove array_containsarray_contains with SQL array functions: array_has, array_has_any, array_has_all
alamb
left a comment
There was a problem hiding this comment.
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.
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.
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]>
izveigor
left a comment
There was a problem hiding this comment.
LGTM! Thanks, @jayzhan211!
alamb
left a comment
There was a problem hiding this comment.
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?