Skip to content

[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

Closed
wants to merge 3 commits into from

Conversation

felixcheung
Copy link
Member

What changes were proposed in this pull request?

df$foo <- 1

instead of

df$foo <- lit(1)

How was this patch tested?

unit tests

@SparkQA
Copy link

SparkQA commented Jan 9, 2017

Test build #71059 has finished for PR 16510 at commit f90a841.

  • This patch fails SparkR unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jan 9, 2017

Test build #71062 has finished for PR 16510 at commit a706c15.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@rxin
Copy link
Contributor

rxin commented Jan 10, 2017

This is pretty useful!

Copy link
Contributor

@shivaram shivaram left a 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")
Copy link
Contributor

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 ?)

Copy link
Member Author

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

@SparkQA
Copy link

SparkQA commented Jan 11, 2017

Test build #71183 has finished for PR 16510 at commit b10ae77.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@shivaram
Copy link
Contributor

Merging this to master, branch-2.1

asfgit pushed a commit that referenced this pull request Jan 11, 2017
## 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>
@asfgit asfgit closed this in d749c06 Jan 11, 2017
@shivaram
Copy link
Contributor

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

uzadude pushed a commit to uzadude/spark that referenced this pull request Jan 27, 2017
## 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.
cmonkey pushed a commit to cmonkey/spark that referenced this pull request Feb 15, 2017
## 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants