Skip to content

Commit

Permalink
Revert test back.
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Jul 29, 2020
1 parent 7173918 commit c788144
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions core/src/test/scala/org/apache/spark/rdd/RDDSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class RDDSuite extends SparkFunSuite with SharedSparkContext with Eventually {

test("SparkContext.union") {
val nums = sc.makeRDD(Array(1, 2, 3, 4), 2)
assert(sc.union(nums).collect().toList === List(2, 2, 3, 4))
assert(sc.union(nums).collect().toList === List(1, 2, 3, 4))
assert(sc.union(nums, nums).collect().toList === List(1, 2, 3, 4, 1, 2, 3, 4))
assert(sc.union(Seq(nums)).collect().toList === List(1, 2, 3, 4))
assert(sc.union(Seq(nums, nums)).collect().toList === List(1, 2, 3, 4, 1, 2, 3, 4))
Expand Down Expand Up @@ -222,7 +222,7 @@ class RDDSuite extends SparkFunSuite with SharedSparkContext with Eventually {
val rdd = sc.makeRDD(-1000 until 1000, 10)
def op: (Int, Int) => Int = (c: Int, x: Int) => c + x
val sum = rdd.fold(0)(op)
assert(sum === -1001)
assert(sum === -1000)
}

test("fold with op modifying first arg") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SortingSuite extends SparkFunSuite with SharedSparkContext with Matchers w

test("sortByKey") {
val pairs = sc.parallelize(Seq((1, 0), (2, 0), (0, 0), (3, 0)), 2)
assert(pairs.sortByKey().collect() === Array((2, 0), (1, 0), (2, 0), (3, 0)))
assert(pairs.sortByKey().collect() === Array((0, 0), (1, 0), (2, 0), (3, 0)))
}

test("large array") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class DataFrameAggregateSuite extends QueryTest

checkAnswer(
df.groupBy(regexp_extract($"key", "([a-z]+)\\[", 1)).count(),
Row("some", 2) :: Nil
Row("some", 1) :: Nil
)
}

Expand Down Expand Up @@ -160,7 +160,7 @@ class DataFrameAggregateSuite extends QueryTest
checkAnswer(
courseSales.cube("course", "year")
.agg(grouping("course"), grouping("year"), grouping_id("course", "year")),
Row("Java", 2012, 0, 0, 1) ::
Row("Java", 2012, 0, 0, 0) ::
Row("Java", 2013, 0, 0, 0) ::
Row("Java", null, 0, 1, 1) ::
Row("dotNET", 2012, 0, 0, 0) ::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class DataFrameSuite extends QueryTest

checkAnswer(
df.groupBy("_1").agg(sum("_2._1")).toDF("key", "total"),
Row(2, 1) :: Nil)
Row(1, 1) :: Nil)
}

test("access complex data") {
Expand Down Expand Up @@ -146,7 +146,7 @@ class DataFrameSuite extends QueryTest
sort("a").first() == Row(1, Seq(1, 1)))

// CreateStruct and CreateArray in project list (unresolved alias)
assert(structDf.select(struct($"record.*")).first() == Row(Row(2, 1)))
assert(structDf.select(struct($"record.*")).first() == Row(Row(1, 1)))
assert(structDf.select(array($"record.*")).first().getAs[Seq[Int]](0) === Seq(1, 1))

// CreateStruct and CreateArray in project list (alias)
Expand Down

0 comments on commit c788144

Please sign in to comment.