-
Notifications
You must be signed in to change notification settings - Fork 28k
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
[SPARK-9165][SQL] codegen for CreateArray, CreateStruct and CreateNamedStruct #7537
Conversation
3191341
to
39cefb8
Compare
/cc @rxin |
Test build #1133 has finished for PR 7537 at commit
|
val strSeq = intSeq.map(_.toString) | ||
checkEvaluation(CreateArray(intSeq.map(Literal(_))), intSeq, EmptyRow) | ||
checkEvaluation(CreateArray(longSeq.map(Literal(_))), longSeq, EmptyRow) | ||
checkEvaluation(CreateArray(strSeq.map(Literal(_))), strSeq, EmptyRow) |
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.
Maybe add a test that includes null values?
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.
added below.
Thanks @marmbrus , I would update my code soon. |
695ed31
to
5e90f0a
Compare
Test build #1142 has finished for PR 7537 at commit
|
val strWithNull = strSeq.map(Literal(_)).+:(Literal.create(null, StringType)) | ||
checkEvaluation(CreateArray(intWithNull), intSeq.+:(null), EmptyRow) | ||
checkEvaluation(CreateArray(longWithNull), longSeq.+:(null), EmptyRow) | ||
checkEvaluation(CreateArray(strWithNull), strSeq.+:(null), EmptyRow) |
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.
Sorry to nit-pick, but what is happening here is kind of confusing:
scala> List(1,2).+:(null)
res0: List[Any] = List(null, 1, 2)
Perhaps just use infix notation for operators:
scala> List(1,2) :+ null
res1: List[Any] = List(1, 2, null)
Thanks! Merged to master. |
JIRA: https://issues.apache.org/jira/browse/SPARK-9165