[
https://issues.apache.org/jira/browse/PHOENIX-2433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15096609#comment-15096609
]
James Taylor commented on PHOENIX-2433:
---------------------------------------
Thanks for the patch, [~maghamravikiran]. I believe you can remove the if
statement for timeUnit in the constructor as well. There should be no
adjustment necessary to divBy as the client would have adjusted it already and
serialized the correct value.
{code}
- timeUnit = TimeUnit.getTimeUnit(timeUnitValue != null ?
timeUnitValue.toString() : null);
+ TimeUnit timeUnit = TimeUnit.getTimeUnit(timeUnitValue != null ?
timeUnitValue.toString() : null);
if(timeUnit.ordinal() < TIME_UNIT_MS.length) {
divBy = multiplier * TIME_UNIT_MS[timeUnit.ordinal()];
}
{code}
> support additional time units (like week/month/year) in Trunc() round() and
> Ceil()
> -----------------------------------------------------------------------------------
>
> Key: PHOENIX-2433
> URL: https://issues.apache.org/jira/browse/PHOENIX-2433
> Project: Phoenix
> Issue Type: Improvement
> Reporter: noam bulvik
> Assignee: maghamravikiran
> Labels: newbie
> Fix For: 4.7.0
>
> Attachments: PHOENIX-2433-2.patch, PHOENIX-2433-firstdrop.patch,
> PHOENIX-2433-minor-fix.patch, PHOENIX-2433.patch
>
>
> currently the time units that are supported in trunk(), round(), ceil are
> day/hour/minute/seconds/milliseconds.
> It should support also other values like week, month, year
> You can see how it is documented for Oracle in
> http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions201.htm and
> different supported level in
> http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions230.htm#i1002084
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)