-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-23914][SQL] Add array_union function #21061
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
dc9d6f0
3019840
8cee6cf
2041ec4
8c2280b
b3a3132
a2c7dd1
5313680
98f8d1f
30ee7fc
cd347e9
d2eaee3
2ddeb06
71b31f0
7e71340
04c97c3
401ca7a
15b953b
f050922
8a27667
e50bc55
7e3f2ef
e5401e7
3e21e48
3c39506
6654742
be9f331
90e84b3
6f721f0
0c0d3ba
4a217bc
f5ebbe8
763a1f8
7b51564
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 |
|---|---|---|
|
|
@@ -1185,6 +1185,8 @@ class CollectionExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper | |
| val a20 = Literal.create(Seq("b", "a", "c"), ArrayType(StringType)) | ||
| val a21 = Literal.create(Seq("c", "d", "a", "f"), ArrayType(StringType)) | ||
| val a22 = Literal.create(Seq("b", null, "a", "g"), ArrayType(StringType)) | ||
| val a23 = Literal.create(Seq("b", "a", "c"), ArrayType(StringType, false)) | ||
| val a24 = Literal.create(Seq("c", "d", "a", "f"), ArrayType(StringType, false)) | ||
|
|
||
| val a30 = Literal.create(Seq(null, null), ArrayType(NullType)) | ||
|
|
||
|
|
@@ -1201,6 +1203,7 @@ class CollectionExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper | |
|
|
||
| checkEvaluation(ArrayUnion(a20, a21), Seq("b", "a", "c", "d", "f")) | ||
| checkEvaluation(ArrayUnion(a20, a22), Seq("b", "a", "c", null, "g")) | ||
| checkEvaluation(ArrayUnion(a23, a24), Seq("b", "c", "d", "a", "f")) | ||
|
|
||
| checkEvaluation(ArrayUnion(a30, a30), Seq(null)) | ||
|
||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
If the array of col1 contains duplicate elements itself, what it does? de-duplicate them too?
E.g.,
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.
After reading the code, seems it de-duplicates all elements from two arrays. Is this behavior the same as Presto?
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 will add the tests for duplication.
Yes, this will de-duplicate. I think that it is the same behavior as Presto.