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

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

Don't use {{rs.getTimestamp(1).toString()}}, but instead use 
rs.getTimestamp(1).getTime() and ensure that the millisecond value was 
increased by one. Otherwise, yes, adding one day to a Time gets you the same 
time in the next day. However, Phoenix stores the entire date, not just the 
time part, so you should see the millisecond value increase (which is non 
standard, but that's the way it works).

> 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: ramkrishna.s.vasudevan
>            Priority: Minor
>              Labels: date, newbie, phoenix, timestamp
>             Fix For: 4.7.0
>
>         Attachments: PHOENIX-2475_1_master.patch, PHOENIX-2475_master.patch
>
>
> 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)

Reply via email to