File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
main/scala/org/apache/spark/rdd
test/scala/org/apache/spark/rdd Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1004,7 +1004,7 @@ abstract class RDD[T: ClassTag](
10041004 },
10051005 (h1 : HyperLogLogPlus , h2 : HyperLogLogPlus ) => {
10061006 h1.addAll(h2)
1007- h2
1007+ h1
10081008 }).cardinality()
10091009 }
10101010
Original file line number Diff line number Diff line change @@ -81,11 +81,11 @@ class RDDSuite extends FunSuite with SharedSparkContext {
8181
8282 def error (est : Long , size : Long ) = math.abs(est - size) / size.toDouble
8383
84- val size = 100
85- val uniformDistro = for (i <- 1 to 100000 ) yield i % size
86- val simpleRdd = sc.makeRDD(uniformDistro)
87- assert(error(simpleRdd.countApproxDistinct(4 , 0 ), size) < 0.4 )
88- assert(error(simpleRdd.countApproxDistinct(8 , 0 ), size) < 0.1 )
84+ val size = 1000
85+ val uniformDistro = for (i <- 1 to 5000 ) yield i % size
86+ val simpleRdd = sc.makeRDD(uniformDistro, 10 )
87+ assert(error(simpleRdd.countApproxDistinct(8 , 0 ), size) < 0.2 )
88+ assert(error(simpleRdd.countApproxDistinct(12 , 0 ), size) < 0.1 )
8989 }
9090
9191 test(" SparkContext.union" ) {
You can’t perform that action at this time.
0 commit comments