[ 
https://issues.apache.org/jira/browse/CALCITE-759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16491234#comment-16491234
 ] 

Sergey Nuyanzin commented on CALCITE-759:
-----------------------------------------

Not fully understand what is wrong with existing DAYOFWEEK, DAYOFMONTH, 
DAYOFYEAR, QUARTER in Calcite {noformat}0: 
jdbc:calcite:model=target/test-classes/mod> select dayofweek(date '2007-02-03');
+---------------------+
|       EXPR$0        |
+---------------------+
| 7                   |
+---------------------+
1 row selected (0.023 seconds)
0: jdbc:calcite:model=target/test-classes/mod> select dayofyear(date 
'2007-02-03');
+---------------------+
|       EXPR$0        |
+---------------------+
| 34                  |
+---------------------+
1 row selected (0.132 seconds)
0: jdbc:calcite:model=target/test-classes/mod> select dayofmonth(date 
'2007-02-03');
+---------------------+
|       EXPR$0        |
+---------------------+
| 3                   |
+---------------------+
1 row selected (0.042 seconds)
0: jdbc:calcite:model=target/test-classes/mod> select quarter(date 
'2007-02-03');
+---------------------+
|       EXPR$0        |
+---------------------+
| 1                   |
+---------------------+
{noformat}
?

> Add DayOfWeek and other missing date/time functions
> ---------------------------------------------------
>
>                 Key: CALCITE-759
>                 URL: https://issues.apache.org/jira/browse/CALCITE-759
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>            Priority: Major
>              Labels: dialect, newbie
>
> Calcite implements EXTRACT, FLOOR, CEIL, CAST, +, - on date/time values and 
> much can be accomplished with these. But there are other useful functions in 
> other databases.
> For example MySQL has DayOfWeek. See 
> https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html. It is 
> tricky to achieve the same in Calcite (you'd need to subtract the epoch and 
> take the interval modulo 7).
> We need to review the date/time functions in MySQL, Postgres and Oracle, and 
> add functions to ensure that you can accomplish the same things in Calcite 
> fairly easily.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to