[
https://issues.apache.org/jira/browse/TAJO-414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13847188#comment-13847188
]
Hudson commented on TAJO-414:
-----------------------------
FAILURE: Integrated in Tajo-trunk-postcommit #613 (See
[https://builds.apache.org/job/Tajo-trunk-postcommit/613/])
TAJO-414: Fix bug of bit operations in decode() method of DateDatum class.
(Keuntae Park via jihoon) (jihoonson:
https://git-wip-us.apache.org/repos/asf?p=incubator-tajo.git&a=commit&h=fe7515d66a2ec3ef4fe0e33cb050e93f7e93631f)
* CHANGES.txt
* tajo-common/src/main/java/org/apache/tajo/datum/DateDatum.java
> Fix bug of bit operations in decode() method of DateDatum class
> ---------------------------------------------------------------
>
> Key: TAJO-414
> URL: https://issues.apache.org/jira/browse/TAJO-414
> Project: Tajo
> Issue Type: Bug
> Reporter: Keuntae Park
> Assignee: Keuntae Park
> Priority: Trivial
> Attachments: TAJO-414.patch
>
>
> data structure for date is 32 bits and consists of
> |meaning | Year | Month | Day |
> | bit offset | 31-16 | 15-8 | 7 - 0|
> However, current code does not correctly decode the structure as
> {noformat}
> private static LocalDate decode(int val) {
> int year = (val >> 16);
> int monthOfYear = (0x0FFF & val) >> 8;
> int dayOfMonth = (0xF0FF & val);
> return new LocalDate(year, monthOfYear, dayOfMonth);
> }
> {noformat}
> Bit operations should be changed to
> {noformat}
> int monthOfYear = (0xFFFF & val) >> 8;
> int dayOfMonth = (0x00FF & val);
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.1.4#6159)