tajo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keuntae Park (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TAJO-60) Implement Date Datum Type
Date Thu, 12 Dec 2013 06:35:07 GMT

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

Keuntae Park commented on TAJO-60:
----------------------------------

[~hyunsik] I have a question just for curiosity :)
Is there any reason that decode() method has following bit operations ?
{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}
Because I think following code is more literal interpretation of date type (year: 2bytes,
month: 1bytes, day: 1bytes)
{noformat}
    int monthOfYear = (0xFFFF & val) >> 8;
    int dayOfMonth = (0x00FF & val);
{noformat}
Of course, I know both have the same results as month value should be between 1 and 12, which
is smaller than 0xF.

> Implement Date Datum Type
> -------------------------
>
>                 Key: TAJO-60
>                 URL: https://issues.apache.org/jira/browse/TAJO-60
>             Project: Tajo
>          Issue Type: Sub-task
>          Components: catalog
>            Reporter: Hyunsik Choi
>            Assignee: Hyunsik Choi
>             Fix For: 0.8-incubating
>
>         Attachments: TAJO-60.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Mime
View raw message