Github user jkbradley commented on the pull request:
https://github.com/apache/spark/pull/3702#issuecomment-67428833
We're in agreement. My earlier statement "The simplistic approach should
never be off by more than numPartitions." meant that the total count would
never be off by more than numPartitions, i.e., +/- 1 per partition.
Are you asking about oversampling? If so, then I had these 2 options in
mind for approximations:
1. In each partition, take samples evenly spaced ceil(rdd.count /
numPartitions) apart. Return however many bins you get back. The # of bins
will be approximate, and the bin spacing (i.e., the # of elements in each bin)
will vary a little across bins.
2. Do the same, but take extra samples (3X ?) and then take exactly numBins
samples on the driver. The # of bins returned will be exact, and the bin
spacing will be a little more uniform.
---
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.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]