GitHub user mengxr opened a pull request:
https://github.com/apache/spark/pull/3010
[SPARK-4148][PySpark] fix seed distribution and add some tests for
rdd.sample
The current way of seed distribution makes the sequences sampled from
partition i and i+1 offset by 1.
~~~
In [14]: import random
In [15]: r1 = random.Random(10)
In [16]: r1.randint(0, 1)
Out[16]: 1
In [17]: r1.random()
Out[17]: 0.4288890546751146
In [18]: r1.random()
Out[18]: 0.5780913011344704
In [19]: r2 = random.Random(10)
In [20]: r2.randint(0, 1)
Out[20]: 1
In [21]: r2.randint(0, 1)
Out[21]: 0
In [22]: r2.random()
Out[22]: 0.5780913011344704
~~~
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/mengxr/spark SPARK-4148
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/3010.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 #3010
----
commit c1bacd9f46fe5559d4affa74dd986c79cced1611
Author: Xiangrui Meng <[email protected]>
Date: 2014-10-30T03:22:13Z
fix seed distribution and add some tests for rdd.sample
----
---
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]