Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/916#discussion_r13691458
--- Diff: python/pyspark/rdd.py ---
@@ -365,27 +366,25 @@ def takeSample(self, withReplacement, num, seed=None):
fraction = 0.0
total = 0
- multiplier = 3.0
+ numStDev = 10.0
initialCount = self.count()
- maxSelected = 0
- if (num < 0):
+ if num < 0:
raise ValueError
- if (initialCount == 0):
+ if initialCount == 0:
--- End diff --
The logic here is wrong. If the RDD is empty but the sample size is not
zero, we should throw an exception.
---
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.
---