[
https://issues.apache.org/jira/browse/CALCITE-6396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17872649#comment-17872649
]
Caican Cai edited comment on CALCITE-6396 at 8/11/24 1:58 AM:
--------------------------------------------------------------
[~mbudiu]
You are correct. I found similar records in Oracle, which support string,
double and other types, and are implemented through implicit conversion. I will
improve this PR.
https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/ADD_MONTHS.html.
{code:java}
ADD_MONTHS returns the date date plus integer months. A month is defined by the
session parameter NLS_CALENDAR. The date argument can be a datetime value or
any value that can be implicitly converted to DATE. The integer argument can be
an integer or any value that can be implicitly converted to an integer. The
return type is always DATE, regardless of the data type of date. If date is the
last day of the month or if the resulting month has fewer days than the day
component of date, then the result is the last day of the resulting month.
Otherwise, the result has the same day component as date.
{code}
was (Author: JIRAUSER302115):
[~mbudiu]
You are correct. I found similar records in Oracle, which support string,
double and other types, and are implemented through implicit conversion. I will
improve this PR.
https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/ADD_MONTHS.html.
{code:shell}
ADD_MONTHS returns the date date plus integer months. A month is defined by the
session parameter NLS_CALENDAR. The date argument can be a datetime value or
any value that can be implicitly converted to DATE. The integer argument can be
an integer or any value that can be implicitly converted to an integer. The
return type is always DATE, regardless of the data type of date. If date is the
last day of the month or if the resulting month has fewer days than the day
component of date, then the result is the last day of the resulting month.
Otherwise, the result has the same day component as date.
{code}
> Add ADD_MONTHS function (enabled in Spark library)
> --------------------------------------------------
>
> Key: CALCITE-6396
> URL: https://issues.apache.org/jira/browse/CALCITE-6396
> Project: Calcite
> Issue Type: New Feature
> Components: core
> Affects Versions: 1.36.0
> Reporter: Caican Cai
> Assignee: Caican Cai
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.38.0
>
>
> Add ADD_MONTHS function (enabled in Spark library)
>
> https://spark.apache.org/docs/2.3.0/api/sql/index.html#add_months
--
This message was sent by Atlassian Jira
(v8.20.10#820010)