spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun-rui <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-10905][SparkR]: Export freqItems() for ...
Date Fri, 09 Oct 2015 02:43:39 GMT
Github user sun-rui commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8962#discussion_r41592822
  
    --- Diff: R/pkg/inst/tests/test_sparkSQL.R ---
    @@ -1341,6 +1341,29 @@ test_that("cov() and corr() on a DataFrame", {
       expect_true(abs(result - 1.0) < 1e-12)
     })
     
    +test_that("freqItems() on a DataFrame", {
    +  input <- 1:1000
    +  rdf <- data.frame(numbers = input, letters = as.character(input),
    +                    negDoubles = input * -1.0, stringsAsFactors = F)
    +  rdf[ input %% 3 == 0, ] <- c(1, "1", -1)
    +  df <- createDataFrame(sqlContext, rdf)
    +  multiColResults <- freqItems(df, c("numbers", "letters"), support=0.1)
    +  expect_true(1 %in% multiColResults$numbers[[1]])
    +  expect_true("1" %in% multiColResults$letters[[1]])
    +  singleColResult <- freqItems(df, "negDoubles", support=0.1)
    +  expect_true(-1 %in% head(singleColResult$negDoubles)[[1]])
    +})
    +
    +test_that("freqItems2() on a DataFrame", {
    --- End diff --
    
    Don't need to add a new test_that. Just move this test case into the above one.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message