Skip to content
Snippets Groups Projects
Commit ae26911e authored by Matei Zaharia's avatar Matei Zaharia
Browse files

Add back test for distinct without parens

parent 7ae4b6a2
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,8 @@ class RDDSuite extends FunSuite with LocalSparkContext { ...@@ -12,7 +12,8 @@ class RDDSuite extends FunSuite with LocalSparkContext {
val nums = sc.makeRDD(Array(1, 2, 3, 4), 2) val nums = sc.makeRDD(Array(1, 2, 3, 4), 2)
assert(nums.collect().toList === List(1, 2, 3, 4)) assert(nums.collect().toList === List(1, 2, 3, 4))
val dups = sc.makeRDD(Array(1, 1, 2, 2, 3, 3, 4, 4), 2) val dups = sc.makeRDD(Array(1, 1, 2, 2, 3, 3, 4, 4), 2)
assert(dups.distinct().count === 4) assert(dups.distinct().count() === 4)
assert(dups.distinct.count === 4) // Can distinct and count be called without parentheses?
assert(dups.distinct().collect === dups.distinct().collect) assert(dups.distinct().collect === dups.distinct().collect)
assert(dups.distinct(2).collect === dups.distinct().collect) assert(dups.distinct(2).collect === dups.distinct().collect)
assert(nums.reduce(_ + _) === 10) assert(nums.reduce(_ + _) === 10)
......
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