Github user shivaram commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13721#discussion_r67457504
  
    --- Diff: R/pkg/inst/tests/testthat/test_sparkSQL.R ---
    @@ -2264,6 +2264,14 @@ test_that("createDataFrame sqlContext parameter 
backward compatibility", {
       expect_equal(collect(before), collect(after))
     })
     
    +test_that("randomSplit", {
    +  df <- createDataFrame(data.frame(id = 1:1000))
    +  df_list <- randomSplit(df, c(2, 3, 5))
    +  expect_equal(1000, sum(sapply(df_list, count)))
    +  df_list <- randomSplit(df, c(2, 3, 5), 0)
    +  expect_equal(1000, sum(sapply(df_list, count)))
    --- End diff --
    
    for the seeded version it will be good to add some test on how many 
elements should be present in each data frame (i.e. checking if the ratios are 
0.2, 0.3 and 0.5 approximately)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to