Skip to content

Commit 3a3d59c

Browse files
author
Vinod K C
committed
Reverted removal of validation relativeSD<0.000017
1 parent 799976e commit 3a3d59c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

python/pyspark/rdd.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2237,6 +2237,8 @@ def countApproxDistinct(self, relativeSD=0.05):
22372237
>>> 16 < n < 24
22382238
True
22392239
"""
2240+
if relativeSD < 0.000017:
2241+
raise ValueError("relativeSD should be greater than 0.000017")
22402242
# the hash space in Java is 2^32
22412243
hashRDD = self.map(lambda x: portable_hash(x) & 0xFFFFFFFF)
22422244
return hashRDD._to_java_object_rdd().countApproxDistinct(relativeSD)

0 commit comments

Comments
 (0)