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

    https://github.com/apache/spark/pull/8782#discussion_r39725671
  
    --- Diff: 
mllib/src/test/java/org/apache/spark/mllib/random/JavaRandomRDDsSuite.java ---
    @@ -231,4 +232,30 @@ public void testGammaVectorRDD() {
         }
       }
     
    +  @Test
    +  public void testArbitrary() {
    +    long size = 10;
    +    long seed = 1L;
    +    int numPartitions = 0;
    +    StringGenerator gen = new StringGenerator();
    +    JavaRDD<String> rdd1 = randomJavaRDD(sc, gen, size);
    +    JavaRDD<String> rdd2 = randomJavaRDD(sc, gen, size, numPartitions);
    +    JavaRDD<String> rdd3 = randomJavaRDD(sc, gen, size, numPartitions, 
seed);
    +    for (JavaRDD<String> rdd: Arrays.asList(rdd1, rdd2, rdd3)) {
    +      Assert.assertEquals(size, rdd.count());
    +      Assert.assertEquals(2, rdd.first().length());
    +    }
    +  }
    +}
    +
    +// This is just a test generator, it always returns a string of 42
    +class StringGenerator implements RandomDataGenerator<String>, Serializable 
{
    +  @Override public String nextValue() {
    --- End diff --
    
    This is all nit picking but I think `@Override` and other annotations go on 
a separate line at least in the Spark code I see. The last two methods miss a 
space before the brace. You might sort `java.io` imports earlier.


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

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

Reply via email to