Skip to content
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-13389] [SparkR] SparkR support first/last with ignore NAs #11267

Closed
wants to merge 2 commits into from

Conversation

yanboliang
Copy link
Contributor

What changes were proposed in this pull request?

SparkR support first/last with ignore NAs

cc @sun-rui @felixcheung @shivaram

How was the this patch tested?

unit tests

@SparkQA
Copy link

SparkQA commented Feb 19, 2016

Test build #51546 has finished for PR 11267 at commit a30bd4a.

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

@shivaram
Copy link
Contributor

Is this option used by base R / other R libraries like dplyr ?

function(x) {
jc <- callJStatic("org.apache.spark.sql.functions", "first", x@jc)
signature(x = "characterOrColumn"),
function(x, ignoreNAs = FALSE) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably something like na.rm=TRUE would be more R like
or na.omit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense, I will update. Thanks!

@yanboliang
Copy link
Contributor Author

@shivaram Several R packages have similar function such as first, aggregate, etc. Users need this feature in R and did some workaround.

@SparkQA
Copy link

SparkQA commented Feb 22, 2016

Test build #51656 has finished for PR 11267 at commit 6e78f7c.

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

@shivaram
Copy link
Contributor

Thanks @yanboliang -- Sorry for the delay in looking at this. I think this looks good. Merging to master

@asfgit asfgit closed this in 4d535d1 Mar 11, 2016
@yanboliang yanboliang deleted the spark-13389 branch March 11, 2016 03:13
roygao94 pushed a commit to roygao94/spark that referenced this pull request Mar 22, 2016
## What changes were proposed in this pull request?

SparkR support first/last with ignore NAs

cc sun-rui felixcheung shivaram

## How was the this patch tested?

unit tests

Author: Yanbo Liang <ybliang8@gmail.com>

Closes apache#11267 from yanboliang/spark-13389.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants