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

    https://github.com/apache/spark/pull/16776#discussion_r100711390
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/DataFrameStatFunctions.scala ---
    @@ -63,44 +63,49 @@ final class DataFrameStatFunctions private[sql](df: 
DataFrame) {
        *   Note that values greater than 1 are accepted but give the same 
result as 1.
        * @return the approximate quantiles at the given probabilities
        *
    -   * @note NaN values will be removed from the numerical column before 
calculation
    +   * @note null and NaN values will be removed from the numerical column 
before calculation
        *
        * @since 2.0.0
        */
       def approxQuantile(
           col: String,
           probabilities: Array[Double],
           relativeError: Double): Array[Double] = {
    -    StatFunctions.multipleApproxQuantiles(df.select(col).na.drop(),
    -      Seq(col), probabilities, relativeError).head.toArray
    +    val res = approxQuantile(Array(col), probabilities, relativeError)
    +    if (res != null) {
    +      res.head
    +    } else {
    +      null
    +    }
       }
     
       /**
        * Calculates the approximate quantiles of numerical columns of a 
DataFrame.
    -   * @see [[DataFrameStatsFunctions.approxQuantile(col:Str* 
approxQuantile]] for
    -   *     detailed description.
    +   * @see `DataFrameStatsFunctions.approxQuantile` for detailed 
description.
    --- End diff --
    
    Did this link cause problems in doc generation?  It looks like there is a 
missing ")" in the original link.  If you add the ")" then will it generate 
correctly (with a hyperlink) for the Scala and Java docs?


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to