[
https://issues.apache.org/jira/browse/CALCITE-1921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16112404#comment-16112404
]
Julian Hyde commented on CALCITE-1921:
--------------------------------------
Calcite already supports {{EXTRACT(DAY FROM dateTime)}}. It's reasonable to
support {{DAY(dateTime)}} as syntactic sugar for that. It should be enabled
only in MySQL-compatible mode.
{{DAY}} is already a reserved keyword, in Calcite's parser and in the SQL
standard (ever since SQL:92). Not sure what you mean by "reserved function
name".
> Add DAY as Reserved Function Name, And add day() build-in scalar function
> -------------------------------------------------------------------------
>
> Key: CALCITE-1921
> URL: https://issues.apache.org/jira/browse/CALCITE-1921
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: sunjincheng
> Assignee: sunjincheng
>
> I want add `DAY()` as build-in scalar function in calcite. It's looks like as
> following:
> DAY('2015-04-30 01:01:01.1234567') -> 30
> DAYOFMONTH('2007-02-03') -> 3
> What do you think [~julianhyde] :-) ?
> * MySql: DAY() is a synonym for DAYOFMONTH().
>
> https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_day
> * MsSql: DAY returns the same value as DATEPART (day, date).
> https://docs.microsoft.com/en-us/sql/t-sql/functions/day-transact-sql
> * Oracle: Do not support `Day()`
>
> http://docs.oracle.com/cd/E11882_01/server.112/e41084/functions002.htm#SQLRF51179
> * SQL2003:
> http://jtc1sc32.org/doc/N2301-2350/32N2311T-text_for_ballot-CD_9075-2.pdf
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)