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

    https://github.com/apache/spark/pull/4332#discussion_r23991126
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/Dsl.scala ---
    @@ -100,27 +91,82 @@ object Dsl {
         Column(literalExpr)
       }
     
    +  
//////////////////////////////////////////////////////////////////////////////////////////////
    +  
//////////////////////////////////////////////////////////////////////////////////////////////
    +
    +  /** Aggregate function: returns the sum of all values in the expression. 
*/
       def sum(e: Column): Column = Sum(e.expr)
    +
    +  /** Aggregate function: returns the sum of distinct values in the 
expression. */
       def sumDistinct(e: Column): Column = SumDistinct(e.expr)
    +
    +  /** Aggregate function: returns the number of items in a group. */
       def count(e: Column): Column = Count(e.expr)
     
    +  /** Aggregate function: returns the number of distinct items in a group. 
*/
       @scala.annotation.varargs
       def countDistinct(expr: Column, exprs: Column*): Column =
         CountDistinct((expr +: exprs).map(_.expr))
     
    +  /** Aggregate function: returns the approximate number of distinct items 
in a group. */
       def approxCountDistinct(e: Column): Column = ApproxCountDistinct(e.expr)
    -  def approxCountDistinct(e: Column, rsd: Double): Column =
    -    ApproxCountDistinct(e.expr, rsd)
     
    +  /** Aggregate function: returns the approximate number of distinct items 
in a group. */
    +  def approxCountDistinct(e: Column, rsd: Double): Column = 
ApproxCountDistinct(e.expr, rsd)
    +
    +  /** Aggregate function: returns the average of the values in a group. */
       def avg(e: Column): Column = Average(e.expr)
    +
    +  /** Aggregate function: returns the first value in a group. */
       def first(e: Column): Column = First(e.expr)
    +
    +  /** Aggregate function: returns the last value in a group. */
       def last(e: Column): Column = Last(e.expr)
    +
    +  /** Aggregate function: returns the minimum value of the expression in a 
group. */
       def min(e: Column): Column = Min(e.expr)
    +
    +  /** Aggregate function: returns the maximum value of the expression in a 
group. */
       def max(e: Column): Column = Max(e.expr)
     
    +  
//////////////////////////////////////////////////////////////////////////////////////////////
    +  
//////////////////////////////////////////////////////////////////////////////////////////////
    +
    +  /**
    +   * Unary minus, i.e. negate the expression.
    +   * {{{
    +   *   // Select the amount column and negates all values.
    +   *   // Scala:
    +   *   df.select( -df("amount") )
    +   *
    +   *   // Java:
    +   *   df.select( negate(df.col("amount")) );
    +   * }}}
    +   */
    +  def negate(e: Column): Column = -e
    --- End diff --
    
    negative or neg?


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