-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-23931][SQL] Adds arrays_zip function to sparksql #21045
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
7bf45dd
99848fe
27b0bc2
93826b6
a7e29f6
7130fec
d552216
1fecef4
f71151a
6b4bc94
1549928
9f7bba1
3ba2b4f
3a59201
6462fa8
8b1eb7c
2bfba80
c3b062c
d9b95c4
26bbf66
d9ad04d
f29ee1c
c58d09c
38fa996
5b3066b
759a4d4
68e69db
12b3835
643cb9b
5876082
0223960
2b88387
bbc20ee
8d3a838
d8f3dea
3d68ea9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Signed-off-by: DylanGuedes <[email protected]>
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,8 +18,8 @@ | |
| package org.apache.spark.sql.catalyst.expressions | ||
|
|
||
| import org.apache.spark.SparkFunSuite | ||
| import org.apache.spark.sql.catalyst.InternalRow | ||
| import org.apache.spark.sql.Row | ||
| import org.apache.spark.sql.catalyst.InternalRow | ||
| import org.apache.spark.sql.types._ | ||
|
|
||
| class CollectionExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper { | ||
|
|
@@ -377,6 +377,25 @@ class CollectionExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper | |
|
|
||
| checkEvaluation(Zip(Seq(literals(7), literals(10))), | ||
| List(Row(null, Array[Byte](1.toByte, 5.toByte)))) | ||
|
||
|
|
||
| val longLiteral = | ||
| Literal.create((0 to 1000).toSeq, ArrayType(IntegerType)) | ||
|
|
||
| checkEvaluation(Zip(Seq(literals(0), longLiteral)), | ||
| List(Row(9001, 0), Row(9002, 1), Row(9003, 2)) ++ | ||
| (3 to 1000).map { Row(null, _) }.toList) | ||
|
|
||
| val manyLiterals = (0 to 1000).map { case (number) => | ||
|
||
| Literal.create(Seq(1), ArrayType(IntegerType)) | ||
| }.toSeq | ||
|
|
||
| val numbers = List( | ||
| Seq(9001) ++ (0 to 1000).map { case (number) => 1 }.toSeq, | ||
|
||
| Seq(9002) ++ (0 to 1000).map { case (number) => null }.toSeq, | ||
| Seq(9003) ++ (0 to 1000).map { case (number) => null }.toSeq, | ||
| Seq(null) ++ (0 to 1000).map { case (number) => null }.toSeq) | ||
|
||
| checkEvaluation(Zip(Seq(literals(0)) ++ manyLiterals), | ||
| List(Row(numbers(0): _*), Row(numbers(1): _*), Row(numbers(2): _*), Row(numbers(3): _*))) | ||
| } | ||
|
||
|
|
||
| test("Array Min") { | ||
|
|
||
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.
Should
continueto avoid extra evaluation?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 get it, how?