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

Julian Hyde commented on CALCITE-307:
-------------------------------------

Implement cast between date-time types, e.g. CAST(aTimestamp AS DATE), 
CAST(aTime AS TIMESTAMP).

When you cast a TIME to a TIMESTAMP it should yield a time in the current day 
(per CURRENT_DATE).

Also be careful to round down when dealing with timestamps before the epoch 
(which are represented as negative numbers).

> Implement CAST between date-time types
> --------------------------------------
>
>                 Key: CALCITE-307
>                 URL: https://issues.apache.org/jira/browse/CALCITE-307
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>
> See test case in misc.oq. Throws the following: 
> {code}
> java.lang.ClassCastException: java.lang.Long cannot be cast to 
> java.lang.Integer
>       at 
> net.hydromatic.optiq.runtime.AbstractCursor$IntAccessor.getInt(AbstractCursor.java:452)
>       at 
> net.hydromatic.optiq.runtime.AbstractCursor$DateFromIntAccessor.getString(AbstractCursor.java:720)
>       at 
> net.hydromatic.avatica.AvaticaResultSet.getString(AvaticaResultSet.java:205)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to