Skip to content

Commit

Permalink
[SPARK-4860][pyspark][sql] adding sample() to JavaSchemaRDD
Browse files Browse the repository at this point in the history
  • Loading branch information
jbencook committed Dec 23, 2014
1 parent 020cbdf commit b916442
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,4 +218,10 @@ class JavaSchemaRDD(
*/
def subtract(other: JavaSchemaRDD, p: Partitioner): JavaSchemaRDD =
this.baseSchemaRDD.subtract(other.baseSchemaRDD, p).toJavaSchemaRDD

/**
* Return an RDD with a sampled version of the underlying dataset.
*/
def sample(withReplacement: Boolean, fraction: Double, seed: Long): JavaSchemaRDD =
this.baseSchemaRDD.sample(withReplacement, fraction, seed).toJavaSchemaRDD
}

0 comments on commit b916442

Please sign in to comment.