-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-24574][SQL] array_contains, array_position, array_remove and element_at functions deal with Column type #21581
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
Changes from 1 commit
27733f9
28aa515
e65611e
b6e150c
eabdb6e
8440d5b
f8c5b43
ddd94f7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3077,12 +3077,16 @@ object functions { | |
| ////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
|
||
| /** | ||
| * Returns null if the array is null, true if the array contains `value`, and false otherwise. | ||
| * Returns null if the array is null, true if the array contains `value` or the content of | ||
| * `value` if it is of type Column, and false otherwise. | ||
| * @group collection_funcs | ||
| * @since 1.5.0 | ||
| */ | ||
| def array_contains(column: Column, value: Any): Column = withExpr { | ||
| ArrayContains(column.expr, Literal(value)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Other similar expressions are
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I just found @maropu has pointed it out in #21581 (comment). |
||
| value match { | ||
|
||
| case c: Column => ArrayContains(column.expr, c.expr) | ||
| case _ => ArrayContains(column.expr, Literal(value)) | ||
| } | ||
| } | ||
|
|
||
| /** | ||
|
|
||
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.
We need to update this comment? I think
content of valueis a little ambiguous.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.
Hey, thanks for the message. Do you want me to change the comment back? I see that you have started the test, is it too late?
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.
you can fix now