[
https://issues.apache.org/jira/browse/PHOENIX-787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14500456#comment-14500456
]
Samarth Jain commented on PHOENIX-787:
--------------------------------------
[~naveenmadhire] - how about having a test like this:
{code}
long millis = 1000;
int nanos = 200;
Timestamp tsUpserted = DateUtil.getTimestamp(millis, nanosPart);
Upsert the above timestamp
Then doing a select CEIL(ts, 'SECOND') for the above upserted timestamp should
return time as 2000 ms -> 1000 ms + ceil of (.0002) ms = 2000 ms.
Today it is returned as 1000 ms.
{code}
> CEIL function may produce incorrect results for TIMESTAMP
> ---------------------------------------------------------
>
> Key: PHOENIX-787
> URL: https://issues.apache.org/jira/browse/PHOENIX-787
> Project: Phoenix
> Issue Type: Task
> Affects Versions: 3.0-Release
> Reporter: James Taylor
> Labels: Newbie
>
> In the CEIL function, we only consider nanos when the time unit of
> MILLISECONDS is used. However, we should consider it for other time units as
> well. For example, if the time unit is SECONDS and the TIMESTAMP value
> happens to be at an exact multiple of 1000 milliseconds, then the CEIL should
> round up, as their will be nano seconds remaining and thus the TIMESTAMP
> should be rounded up to the next increment.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)