You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Yuming Wang (JIRA)" <ji...@apache.org> on 2019/07/17 10:23:00 UTC
[jira] [Created] (SPARK-28420) Date/Time Functions: date_part
Yuming Wang created SPARK-28420:
-----------------------------------
Summary: Date/Time Functions: date_part
Key: SPARK-28420
URL: https://issues.apache.org/jira/browse/SPARK-28420
Project: Spark
Issue Type: Sub-task
Components: SQL
Affects Versions: 3.0.0
Reporter: Yuming Wang
||Function||Return Type||Description||Example||Result||
|{{date_part(}}{{text}}{{, }}{{timestamp}}{{)}}|{{double precision}}|Get subfield (equivalent to {{extract}}); see [Section 9.9.1|https://www.postgresql.org/docs/11/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT]|{{date_part('hour', timestamp '2001-02-16 20:38:40')}}|{{20}}|
|{{date_part(}}{{text}}{{, }}{{interval}}{{)}}|{{double precision}}|Get subfield (equivalent to {{extract}}); see [Section 9.9.1|https://www.postgresql.org/docs/11/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT]|{{date_part('month', interval '2 years 3 months')}}|{{3}}|
We can replace it with {{extract(field from timestamp)}}.
https://www.postgresql.org/docs/11/functions-datetime.html
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org