-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: array_contains
#6618
feat: array_contains
#6618
Conversation
@@ -1070,6 +1071,70 @@ pub fn array_ndims(args: &[ColumnarValue]) -> Result<ColumnarValue> { | |||
])))) | |||
} | |||
|
|||
macro_rules! contains { |
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.
What the function: https://docs.rs/arrow/latest/arrow/compute/kernels/comparison/fn.in_list.html?
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.
I don't quite understand this comment -- are you saying that it would be better to use the in_list
kernel rather than flattening it?
@alamb I wonder if you review this PR if you have free time. |
I will find time to review this PR, but maybe not until Monday |
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.
This looks great @izveigor -- thank you very much for this contribution.
I agree with your comments in #6557 that it would be interesting to add operators like @>
such as postgres has https://www.postgresql.org/docs/current/functions-array.html. Should we file some follow on tickets to try and crowdsource that work?
@@ -1070,6 +1071,70 @@ pub fn array_ndims(args: &[ColumnarValue]) -> Result<ColumnarValue> { | |||
])))) | |||
} | |||
|
|||
macro_rules! contains { |
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.
I don't quite understand this comment -- are you saying that it would be better to use the in_list
kernel rather than flattening it?
@@ -179,23 +179,24 @@ Unlike to some databases the math functions in Datafusion works the same way as | |||
|
|||
## Array Expressions |
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.
❤️
The other thing I think would help this PR is some tests for the array version in |
Thanks again @izveigor |
* feat: array_contains * feat: regen.sh * docs: array_contains * fix: merge * Update docs/source/user-guide/sql/scalar_functions.md --------- Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Which issue does this PR close?
Closes #6557
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Yes
Are there any user-facing changes?
Yes