Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More tests, and Mima-exclude the new isEmpty method in JavaRDDLike
  • Loading branch information
srowen committed Jan 18, 2015
commit 2e9b49061db5af9b3e040d261cb6788520d1adb9
14 changes: 14 additions & 0 deletions core/src/test/java/org/apache/spark/JavaAPISuite.java
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,20 @@ public void isEmpty() {
Assert.assertTrue(sc.emptyRDD().isEmpty());
Assert.assertTrue(sc.parallelize(new ArrayList<Integer>()).isEmpty());
Assert.assertFalse(sc.parallelize(Arrays.asList(1)).isEmpty());
Assert.assertTrue(sc.parallelize(Arrays.asList(1, 2, 3), 3).filter(
new Function<Integer,Boolean>() {
@Override
public Boolean call(Integer i) {
return i < 0;
}
}).isEmpty());
Assert.assertFalse(sc.parallelize(Arrays.asList(1, 2, 3)).filter(
new Function<Integer, Boolean>() {
@Override
public Boolean call(Integer i) {
return i > 1;
}
}).isEmpty());
}

@Test
Expand Down
2 changes: 2 additions & 0 deletions core/src/test/scala/org/apache/spark/rdd/RDDSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,8 @@ class RDDSuite extends FunSuite with SharedSparkContext {
assert(sc.emptyRDD.isEmpty())
assert(sc.parallelize(Seq[Int]()).isEmpty())
assert(!sc.parallelize(Seq(1)).isEmpty())
assert(sc.parallelize(Seq(1,2,3), 3).filter(_ < 0).isEmpty())
assert(!sc.parallelize(Seq(1,2,3), 3).filter(_ > 1).isEmpty())
}

test("sample preserves partitioner") {
Expand Down
4 changes: 4 additions & 0 deletions project/MimaExcludes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ object MimaExcludes {
// SPARK-5166 Spark SQL API stabilization
ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.spark.ml.Transformer.transform"),
ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.spark.ml.Estimator.fit")
) ++ Seq(
// SPARK-5270
ProblemFilters.exclude[MissingMethodProblem](
"org.apache.spark.api.java.JavaRDDLike.isEmpty")
)

case v if v.startsWith("1.2") =>
Expand Down