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

    https://github.com/apache/spark/pull/20787#discussion_r176946746
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
 ---
    @@ -1117,11 +1117,23 @@ 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.
    --- End diff --
    
    Thanks for improving our doc! 
    
    Could you also add the related tests in our test suite? 
https://github.com/apache/spark/blob/master/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala#L488-L511


---

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

Reply via email to