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

    https://github.com/apache/spark/pull/20787#discussion_r182701579
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
 ---
    @@ -1117,11 +1117,21 @@ case class AddMonths(startDate: Expression, 
numMonths: Expression)
     }
     
     /**
    - * Returns number of months between dates date1 and date2.
    + * Returns number of months between dates `timestamp1` and `timestamp2`.
    + * If `timestamp` is later than `timestamp2`, then the result is positive.
    + * If `timestamp1` and `timestamp2` are on the same day of month, or both
    + * are the last day of month, time of day will be ignored. Otherwise, the
    + * difference is calculated based on 31 days per month, and rounded to
    + * 8 digits.
      */
     // scalastyle:off line.size.limit
     @ExpressionDescription(
    -  usage = "_FUNC_(timestamp1, timestamp2) - Returns number of months 
between `timestamp1` and `timestamp2`.",
    +  usage = """
    +    _FUNC_(timestamp1, timestamp2) - If `timestamp` is later than 
`timestamp2`, then the result
    +    is positive. If `timestamp1` and `timestamp2` are on the same day of 
month, or both
    +    are the last day of month, time of day will be ignored. Otherwise, the
    +    difference is calculated based on 31 days per month, and rounded to 8 
digits.
    +  """,
    --- End diff --
    
    I am not sure why you don't like this format:
    
    ```
      usage = """
        _FUNC_(timestamp1, timestamp2) - If `timestamp` is later than 
`timestamp2`, then the result
          is positive. If `timestamp1` and `timestamp2` are on the same day of 
month, or both
          are the last day of month, time of day will be ignored. Otherwise, 
the difference is
          calculated based on 31 days per month, and rounded to 8 digits.
      """,
    ```
    
    It's actually consistent with other ones such as:
    
    
https://github.com/apache/spark/blob/df7fc3ef3899cadd252d2837092bebe3442d6523/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/ApproximatePercentile.scala#L51-L60
    
    not a big deal but it should be good to match while we are here.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to