[
https://issues.apache.org/jira/browse/FLINK-35850?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
dalongliu reassigned FLINK-35850:
---------------------------------
Assignee: dalongliu
> Add DATEDIFF function
> ---------------------
>
> Key: FLINK-35850
> URL: https://issues.apache.org/jira/browse/FLINK-35850
> Project: Flink
> Issue Type: Sub-task
> Components: Table SQL / API
> Reporter: Dylan He
> Assignee: dalongliu
> Priority: Major
>
> Add DATEDIFF function as the same in Hive & Spark & MySQL, this function is
> similar to DATE_ADD and DATE_SUB, whose time interval unit is fixed to day
> compared with TIMESTAMPDIFF.
> ----
> Returns the number of days from {{startDate}} to {{{}endDate{}}}, the time
> parts of the values are omitted.
> Syntax:
> {code:sql}
> DATEDIFF(endDate, startDate)
> {code}
> Arguments:
> * {{{}endDate{}}}: A DATE expression.
> * {{{}startDate{}}}: A DATE expression.
> Returns:
> An INTEGER.
> See also:
> *
> [Hive|https://cwiki.apache.org/confluence/display/Hive/Hive+UDFs#HiveUDFs-DateFunctions]
> *
> [Spark|https://spark.apache.org/docs/3.5.1/sql-ref-functions-builtin.html#string-functions]
> *
> [Databricks|https://docs.databricks.com/en/sql/language-manual/functions/datediff.html]
> *
> [MySQL|https://dev.mysql.com/doc/refman/8.4/en/date-and-time-functions.html#function_datediff]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)