Github user cloud-fan commented on a diff in the pull request:
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/functions.scala ---
    @@ -2374,14 +2374,14 @@ object functions {
        * @group datetime_funcs
        * @since 1.5.0
    -  def date_add(start: Column, days: Int): Column = withExpr { 
DateAdd(start.expr, Literal(days)) }
    +  def date_add(start: Column, days: Int): Column = withExpr { 
AddDays(start.expr, Literal(days)) }
    --- End diff --
    It's confusing to users that `date_add` add days to the given date and 
`add_months` add months to the given date. I think `add_days` and `add_months` 
are more consistent.
    Other databases(e.g. MySQL, Postgres) only have `date_add` which adds 
interval to the given date, so that they don't need `add_days` and `add_months` 
    The function name is already realsed and maybe hard to change, but changing 
the expression name to match the really logic seems good.
    @rxin any thoughts?

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 or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to