[
https://issues.apache.org/jira/browse/TAJO-414?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Keuntae Park updated TAJO-414:
------------------------------
Description:
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}
was:
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}
> 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
>
> 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)