You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Xiao Li (JIRA)" <ji...@apache.org> on 2018/02/07 07:39:00 UTC

[jira] [Updated] (SPARK-22829) Add new built-in function date_trunc()

     [ https://issues.apache.org/jira/browse/SPARK-22829?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xiao Li updated SPARK-22829:
----------------------------
    Issue Type: Sub-task  (was: New Feature)
        Parent: SPARK-20746

> Add new built-in function date_trunc()
> --------------------------------------
>
>                 Key: SPARK-22829
>                 URL: https://issues.apache.org/jira/browse/SPARK-22829
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 2.3.0
>            Reporter: Youngbin Kim
>            Assignee: Youngbin Kim
>            Priority: Major
>             Fix For: 2.3.0
>
>
> Adding 'date_trunc' as a built-in function.
> 'date_trunc' is common in other databases, but Spark or Hive does not have support for this.
> We do have 'trunc' but this only works with 'MONTH' and 'YEAR' level on the DateType input. ( https://spark.apache.org/docs/2.2.0/api/java/org/apache/spark/sql/functions.html#trunc-org.apache.spark.sql.Column-java.lang.String- )
> 'date_trunc' on other databases:
> AWS Redshift: http://docs.aws.amazon.com/redshift/latest/dg/r_DATE_TRUNC.html
> PostgreSQL: https://www.postgresql.org/docs/9.1/static/functions-datetime.html
> Presto: https://prestodb.io/docs/current/functions/datetime.html



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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