Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/135#discussion_r10579726
  
    --- Diff: core/src/main/scala/org/apache/spark/rdd/RDD.scala ---
    @@ -310,6 +310,9 @@ abstract class RDD[T: ClassTag](
        * Return a sampled subset of this RDD.
        */
       def sample(withReplacement: Boolean, fraction: Double, seed: Int): 
RDD[T] = {
    +    if (fraction < Double.MinValue  || fraction > Double.MaxValue) {
    --- End diff --
    
    Use require. i.e.
    ```scala
    require(fraction > Double.MinValue && fraction < Double.MaxValue, "...")
    ```
    
    Shouldn't you just check for fraction > 0 but < 1?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to