Github user mengxr commented on the pull request:
https://github.com/apache/spark/pull/916#issuecomment-45992111
@colorant Tried the following with the new implementation:
~~~
val rdd = sc.parallelize(0 until 1000000000, 10000).flatMap(i =>
Iterator.fill(10)(0)) // 10^10
rdd.takeSample(false, 1).size
rdd.takeSample(true, 1).size
~~~
Both worked well. We might need a better RNG for even smaller sampling
probabilities. Another solution is set a lower bound in
`comptueFractionForSampleSize`, e.g, `10^{-9}`. I prefer the latter to avoid
using expensive RNGs. Could you run some tests and derive a good lower bound?
Thanks!
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---