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

    https://github.com/apache/spark/pull/15513#discussion_r84573971
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
 ---
    @@ -384,71 +502,157 @@ case class Log2(child: Expression)
     }
     
     @ExpressionDescription(
    -  usage = "_FUNC_(x) - Returns the logarithm of x with base 10.",
    -  extended = "> SELECT _FUNC_(10);\n 1.0")
    +  usage = "_FUNC_(expr) - Returns the logarithm of expr with base 10.",
    +  extended = """
    +    Arguments:
    +      expr - a numeric expression.
    +
    +    Examples:
    +      > SELECT _FUNC_(10);
    +       1.0
    +  """)
     case class Log10(child: Expression) extends UnaryLogExpression(math.log10, 
"LOG10")
     
     @ExpressionDescription(
    -  usage = "_FUNC_(x) - Returns log(1 + x).",
    -  extended = "> SELECT _FUNC_(0);\n 0.0")
    +  usage = "_FUNC_(expr) - Returns log(1 + expr).",
    +  extended = """
    +    Arguments:
    +      expr - a numeric expression.
    +
    +    Examples:
    +      > SELECT _FUNC_(0);
    +       0.0
    +  """)
     case class Log1p(child: Expression) extends UnaryLogExpression(math.log1p, 
"LOG1P") {
       protected override val yAsymptote: Double = -1.0
     }
     
    +// scalastyle:off line.size.limit
     @ExpressionDescription(
    -  usage = "_FUNC_(x, d) - Return the rounded x at d decimal places.",
    -  extended = "> SELECT _FUNC_(12.3456, 1);\n 12.3")
    +  usage = "_FUNC_(expr) - Returns the double value that is closest in 
value to the argument and is equal to a mathematical integer.",
    +  extended = """
    +    Arguments:
    +      expr - a numeric expression.
    +
    +    Examples:
    +      > SELECT _FUNC_(12.3456);
    +       12.0
    +  """)
    +// scalastyle:on line.size.limit
     case class Rint(child: Expression) extends UnaryMathExpression(math.rint, 
"ROUND") {
       override def funcName: String = "rint"
     }
     
     @ExpressionDescription(
    -  usage = "_FUNC_(x) - Returns the sign of x.",
    -  extended = "> SELECT _FUNC_(40);\n 1.0")
    +  usage = "_FUNC_(expr) - Returns the sign of expr.",
    --- End diff --
    
    You might mention that it returns -1, 0, 1 as expr is negative, 0 or 
positive.


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