Skip to content
Snippets Groups Projects
Commit cc14ba97 authored by Kay Ousterhout's avatar Kay Ousterhout Committed by Reynold Xin
Browse files

Merge pull request #544 from kayousterhout/fix_test_warnings. Closes #544.

Fixed warnings in test compilation.

This commit fixes two problems: a redundant import, and a
deprecated function.

Author: Kay Ousterhout <kayousterhout@gmail.com>

== Merge branch commits ==

commit da9d2e13ee4102bc58888df0559c65cb26232a82
Author: Kay Ousterhout <kayousterhout@gmail.com>
Date:   Wed Feb 5 11:41:51 2014 -0800

    Fixed warnings in test compilation.

    This commit fixes two problems: a redundant import, and a
    deprecated function.
parent f7fd80d9
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,6 @@ package org.apache.spark.api.python ...@@ -19,7 +19,6 @@ package org.apache.spark.api.python
import org.scalatest.FunSuite import org.scalatest.FunSuite
import org.scalatest.matchers.ShouldMatchers import org.scalatest.matchers.ShouldMatchers
import org.apache.spark.api.python.PythonRDD
import java.io.{ByteArrayOutputStream, DataOutputStream} import java.io.{ByteArrayOutputStream, DataOutputStream}
......
...@@ -48,7 +48,7 @@ class RDDSuite extends FunSuite with SharedSparkContext { ...@@ -48,7 +48,7 @@ class RDDSuite extends FunSuite with SharedSparkContext {
val partitionSums = nums.mapPartitions(iter => Iterator(iter.reduceLeft(_ + _))) val partitionSums = nums.mapPartitions(iter => Iterator(iter.reduceLeft(_ + _)))
assert(partitionSums.collect().toList === List(3, 7)) assert(partitionSums.collect().toList === List(3, 7))
val partitionSumsWithSplit = nums.mapPartitionsWithSplit { val partitionSumsWithSplit = nums.mapPartitionsWithIndex {
case(split, iter) => Iterator((split, iter.reduceLeft(_ + _))) case(split, iter) => Iterator((split, iter.reduceLeft(_ + _)))
} }
assert(partitionSumsWithSplit.collect().toList === List((0, 3), (1, 7))) assert(partitionSumsWithSplit.collect().toList === List((0, 3), (1, 7)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment