spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Apache Spark (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SPARK-22829) Add new built-in function date_trunc()
Date Tue, 19 Dec 2017 02:32:00 GMT

    [ https://issues.apache.org/jira/browse/SPARK-22829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16296056#comment-16296056
] 

Apache Spark commented on SPARK-22829:
--------------------------------------

User 'youngbink' has created a pull request for this issue:
https://github.com/apache/spark/pull/20015

> Add new built-in function date_trunc()
> --------------------------------------
>
>                 Key: SPARK-22829
>                 URL: https://issues.apache.org/jira/browse/SPARK-22829
>             Project: Spark
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 2.3.0
>            Reporter: Youngbin Kim
>
> 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
(v6.4.14#64029)

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


Mime
View raw message