GitHub user dongjoon-hyun opened a pull request:
https://github.com/apache/spark/pull/13260
[SPARK-15481][CORE] Prevent `takeSample` from calling `collect` multiple
times
## What changes were proposed in this pull request?
`takeSample` might call `collect` multiple times at a very low probability.
This PR logically prevents that by using `count` instead multiple times and
calling `collect` once. Also, this PR fixes some obsolete comments and
assertion in `takeSample` testcase of `RDDSuite.scala`.
## How was this patch tested?
Manual. (The probability is less than 0.0001 according to
`SamplingUtils.scala`.)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dongjoon-hyun/spark SPARK-15481
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/13260.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #13260
----
commit cbabe458e91b56baf04852ec725d91a3c6f4c10b
Author: Dongjoon Hyun <[email protected]>
Date: 2016-05-23T09:14:33Z
[SPARK-15481][CORE] Prevent `takeSample` from calling `collect` multiple
times
----
---
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]