phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Taylor (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-2475) Date arithmetic broken for time and timestamp
Date Thu, 03 Dec 2015 20:18:10 GMT

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

James Taylor commented on PHOENIX-2475:
---------------------------------------

Thanks, [~Dumindux] - FWIW, I'm 99% sure this used to work. If you follow the code path for
DATE, it should be the same for TIME. Both should instantiate DateAddExpression in ExpressionCompiler.
TIMESTAMP should instantiate a TimestampAddExpression. Same deal for date subtraction: DateSubtractExpression
and TimestampSubtractExpression.

> Date arithmetic broken for time and timestamp
> ---------------------------------------------
>
>                 Key: PHOENIX-2475
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2475
>             Project: Phoenix
>          Issue Type: New Feature
>    Affects Versions: 4.6.0
>            Reporter: Kevin Liew
>            Assignee: Dumindu Buddhika
>            Priority: Minor
>              Labels: date, newbie, phoenix, timestamp
>             Fix For: 4.7.0
>
>
> Create a timestamp table and insert a timestamp
> {noformat}create table timestamp_table (ts timestamp primary key)upsert into timestamp_table
values ('1995-05-02 01:01:01'){noformat}
> Example test case
> {noformat}select ts + 1 from timestamp_table{noformat}
> Expected result:
> The timestamp with one day added to it
> {noformat}1995-05-03 01:01:01{noformat}
> Actual result:
> the unmodified timestamp



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

Mime
View raw message