-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[SPARK-19130][SPARKR] Support setting literal value as column implicitly #16510
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
Conversation
Test build #71059 has finished for PR 16510 at commit
|
Test build #71062 has finished for PR 16510 at commit
|
This is pretty useful! |
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.
Thanks @felixcheung - LGTM.
if (isAtomicLengthOne(value)) { | ||
value <- lit(value) | ||
} else { | ||
stop("value must be a Column, Literal value as atomic in length of 1, or NULL") |
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.
nit - it must be literal
(no caps ?)
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 was thinking org.apache.spark.sql.catalyst.expressions.Literal as the type, but I guess i can use the lower case term too
Test build #71183 has finished for PR 16510 at commit
|
Merging this to master, branch-2.1 |
## What changes were proposed in this pull request? ``` df$foo <- 1 ``` instead of ``` df$foo <- lit(1) ``` ## How was this patch tested? unit tests Author: Felix Cheung <felixcheung_m@hotmail.com> Closes #16510 from felixcheung/rlitcol. (cherry picked from commit d749c06) Signed-off-by: Shivaram Venkataraman <shivaram@cs.berkeley.edu>
I can't update JIRA as it seems to be down right now ? (Getting a 503) - Anyways I'll check again in a few hours |
## What changes were proposed in this pull request? ``` df$foo <- 1 ``` instead of ``` df$foo <- lit(1) ``` ## How was this patch tested? unit tests Author: Felix Cheung <felixcheung_m@hotmail.com> Closes apache#16510 from felixcheung/rlitcol.
## What changes were proposed in this pull request? ``` df$foo <- 1 ``` instead of ``` df$foo <- lit(1) ``` ## How was this patch tested? unit tests Author: Felix Cheung <felixcheung_m@hotmail.com> Closes apache#16510 from felixcheung/rlitcol.
What changes were proposed in this pull request?
instead of
How was this patch tested?
unit tests