You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/07/21 05:53:00 UTC
[jira] [Updated] (FLINK-26944) Add ADD_MONTHS supported in SQL and Table API
[ https://issues.apache.org/jira/browse/FLINK-26944?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated FLINK-26944:
-----------------------------------
Labels: pull-request-available (was: )
> Add ADD_MONTHS supported in SQL and Table API
> ---------------------------------------------
>
> Key: FLINK-26944
> URL: https://issues.apache.org/jira/browse/FLINK-26944
> Project: Flink
> Issue Type: Sub-task
> Components: Table SQL / API
> Reporter: dalongliu
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.16.0
>
>
> Returns the date that is {{numMonths}} after {{{}startDate{}}}.
> Syntax:
> {code:java}
> add_months(startDate, numMonths) {code}
> Arguments:
> * {{{}startDate{}}}: A DATE expression.
> * {{{}numMonths{}}}: An integral number.
> Returns:
> A DATE. If the result exceeds the number of days of the month the result is rounded down to the end of the month. If the result exceeds the supported range for a date an overflow error is reported.
> Examples:
> {code:java}
> > SELECT add_months('2016-08-31', 1);
> 2016-09-30
> > SELECT add_months('2016-08-31', -6);
> 2016-02-29 {code}
> See more:
> * [Spark|https://spark.apache.org/docs/latest/sql-ref-functions-builtin.html#date-and-timestamp-functions]
> * [Hive|https://cwiki.apache.org/confluence/display/hive/languagemanual+udf]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)