aboutsummaryrefslogtreecommitdiff
path: root/R/pkg/inst
diff options
context:
space:
mode:
authorDongjoon Hyun <dongjoon@apache.org>2016-06-16 20:35:17 -0700
committerShivaram Venkataraman <shivaram@cs.berkeley.edu>2016-06-16 20:35:17 -0700
commit513a03e41e27d9c5f70911faccc5d3aecd8bdde9 (patch)
tree0b030b7d215d09fd12f6ef7274e91923915f2082 /R/pkg/inst
parent5fd20b66ffe18c05cf257af7f30d32464d2fe8e7 (diff)
downloadspark-513a03e41e27d9c5f70911faccc5d3aecd8bdde9.tar.gz
spark-513a03e41e27d9c5f70911faccc5d3aecd8bdde9.tar.bz2
spark-513a03e41e27d9c5f70911faccc5d3aecd8bdde9.zip
[SPARK-15908][R] Add varargs-type dropDuplicates() function in SparkR
## What changes were proposed in this pull request? This PR adds varargs-type `dropDuplicates` function to SparkR for API parity. Refer to https://issues.apache.org/jira/browse/SPARK-15807, too. ## How was this patch tested? Pass the Jenkins tests with new testcases. Author: Dongjoon Hyun <dongjoon@apache.org> Closes #13684 from dongjoon-hyun/SPARK-15908.
Diffstat (limited to 'R/pkg/inst')
-rw-r--r--R/pkg/inst/tests/testthat/test_sparkSQL.R8
1 files changed, 8 insertions, 0 deletions
diff --git a/R/pkg/inst/tests/testthat/test_sparkSQL.R b/R/pkg/inst/tests/testthat/test_sparkSQL.R
index c11930ada6..11d69366df 100644
--- a/R/pkg/inst/tests/testthat/test_sparkSQL.R
+++ b/R/pkg/inst/tests/testthat/test_sparkSQL.R
@@ -796,6 +796,14 @@ test_that("distinct(), unique() and dropDuplicates() on DataFrames", {
result[order(result$key, result$value1, result$value2), ],
expected)
+ result <- collect(dropDuplicates(df, "key", "value1"))
+ expected <- rbind.data.frame(
+ c(1, 1, 1), c(1, 2, 1), c(2, 1, 2), c(2, 2, 2))
+ names(expected) <- c("key", "value1", "value2")
+ expect_equivalent(
+ result[order(result$key, result$value1, result$value2), ],
+ expected)
+
result <- collect(dropDuplicates(df, "key"))
expected <- rbind.data.frame(
c(1, 1, 1), c(2, 1, 2))