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

Julian Hyde commented on CALCITE-759:
-------------------------------------

[~Stabmeqt] See the discussion in IMPALA-4018 about how Hive and Impala used 
SimpleDateFormat and how it was a mistake.

For example, they give this example:
{noformat}
-- PostgreSQL/Netezza/Vertica/Oracle
select to_timestamp('May 15, 2015 12:00:00', 'mon dd, yyyy hh:mi:ss');
-- Impala
select to_timestamp('May 15, 2015 12:00:00', 'MMM dd, yyyy HH:mm:ss');
{noformat}

We must be compatible with PostgreSQL/Netezza/Vertica/Oracle

> 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
>          Components: babel
>            Reporter: 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