Matthew Powers created SPARK-33975:
--------------------------------------

             Summary: add_hours SQL function
                 Key: SPARK-33975
                 URL: https://issues.apache.org/jira/browse/SPARK-33975
             Project: Spark
          Issue Type: New Feature
          Components: SQL
    Affects Versions: 3.1.0
            Reporter: Matthew Powers


This will add an add_hours function that'll make it easier to add and subtract 
hours from datetime values.  Users currently need to manipulate strings and 
write code like `expr("first_datetime + INTERVAL 2 hours")`.  It'll be a lot 
easier to let them write code like `add_hours(col("first_datetime"), lit(2))`.  
There's [a Stackoverflow question on this topic with a lot of 
views|https://stackoverflow.com/questions/40883084/adding-12-hours-to-datetime-column-in-spark],
 which indicates that this feature will help a lot of users.

See the [GitHub pull request 
description|https://github.com/apache/spark/pull/31000] for additional details.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to