diff options
author | actuaryzhang <actuaryzhang10@gmail.com> | 2017-03-06 21:55:11 -0800 |
---|---|---|
committer | Felix Cheung <felixcheung@apache.org> | 2017-03-06 21:55:11 -0800 |
commit | 1f6c090c15f355a0c2aad736f8291fcdee5c556d (patch) | |
tree | 8e3efe42e7e5fbb3011b9f50c489d43012e1b90f /R/pkg/inst/tests/testthat/test_sparkSQL.R | |
parent | 9909f6d361fdf2b7ef30fa7fbbc91e00f2999794 (diff) | |
download | spark-1f6c090c15f355a0c2aad736f8291fcdee5c556d.tar.gz spark-1f6c090c15f355a0c2aad736f8291fcdee5c556d.tar.bz2 spark-1f6c090c15f355a0c2aad736f8291fcdee5c556d.zip |
[SPARK-19818][SPARKR] rbind should check for name consistency of input data frames
## What changes were proposed in this pull request?
Added checks for name consistency of input data frames in union.
## How was this patch tested?
new test.
Author: actuaryzhang <actuaryzhang10@gmail.com>
Closes #17159 from actuaryzhang/sparkRUnion.
Diffstat (limited to 'R/pkg/inst/tests/testthat/test_sparkSQL.R')
-rw-r--r-- | R/pkg/inst/tests/testthat/test_sparkSQL.R | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/R/pkg/inst/tests/testthat/test_sparkSQL.R b/R/pkg/inst/tests/testthat/test_sparkSQL.R index 7c096597fe..620b633637 100644 --- a/R/pkg/inst/tests/testthat/test_sparkSQL.R +++ b/R/pkg/inst/tests/testthat/test_sparkSQL.R @@ -1850,6 +1850,13 @@ test_that("union(), rbind(), except(), and intersect() on a DataFrame", { expect_equal(count(unioned2), 12) expect_equal(first(unioned2)$name, "Michael") + df3 <- df2 + names(df3)[1] <- "newName" + expect_error(rbind(df, df3), + "Names of input data frames are different.") + expect_error(rbind(df, df2, df3), + "Names of input data frames are different.") + excepted <- arrange(except(df, df2), desc(df$age)) expect_is(unioned, "SparkDataFrame") expect_equal(count(excepted), 2) |