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

Hyunsik Choi commented on TAJO-825:
-----------------------------------

++1

Actually, Hyoungjun and I have discussed this approach in offline for long 
time. So, I agree with this approach. 

Also, I think that this contribution is really incredible. This feature makes 
serialization/deserialization very easier because timestamp, date, and time can 
be dealt as signed long, signed integer, and signed long respectively. Also, I 
believe that this work can parse and print a variety of datetime formats. It's 
comparable to those of commercial databases.

There is only one trivial issues. DateTimePartFromUnixTimestamp is not matched 
to its class file. Could you fix it?

I also hope that other guys review this patch.  If there is no objection for a 
while, I'll commit it.

Thanks,
Hyunsik

> Datetime type refactoring.
> --------------------------
>
>                 Key: TAJO-825
>                 URL: https://issues.apache.org/jira/browse/TAJO-825
>             Project: Tajo
>          Issue Type: Improvement
>            Reporter: Hyoungjun Kim
>            Assignee: Hyoungjun Kim
>         Attachments: TAJO-825.patch
>
>
> Currently Tajo uses Joda time library for Datetime related features.
> I tested Joda library with a next test code. It is difficult to express 
> various time range with Joda library. 
> So I propose that Tajo uses PostgreSQL style date/time features. I already 
> migrated PostgreSQL's date/time code to Tajo. I will attach that patch soon.
> {code}
> Calendar cal = Calendar.getInstance();
> cal.set(Calendar.YEAR, 1582);
> cal.set(Calendar.MONTH, 9);
> cal.set(Calendar.DAY_OF_MONTH, 14);
> SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
> DateTime defaultCalDate = new DateTime(1582, 10, 14, 10, 0, 0, 0);
> Chronology julianChrono = JulianChronology.getInstance();
> DateTime julianCalDate = new DateTime(1582, 10, 14, 10, 0, 0, 0, 
> julianChrono);
> System.out.println("Java Calendar  :" + df.format(cal.getTime()));
> System.out.println("ISO Calendar   : " + defaultCalDate);
> System.out.println("Julian Calendar: " + julianCalDate);
> System.out.println("ISO Calendar's    dayOfWeek: " + 
> defaultCalDate.getDayOfWeek());
> System.out.println("Julian Calendar's dayOfWeek: " + 
> julianCalDate.getDayOfWeek());
> System.out.println("ISO Calendar's    getCenturyOfEra: " + 
> defaultCalDate.getCenturyOfEra());
> System.out.println("Julian Calendar's getCenturyOfEra: " + 
> julianCalDate.getCenturyOfEra());
> {code}
> {noformat}
> Java Calendar  :1582-10-24 16:49:35
> ISO Calendar   : 1582-10-14T10:00:00.000+08:27:52
> Julian Calendar: 1582-10-14T10:00:00.000+08:27:52
> ISO Calendar's    dayOfWeek: 4
> Julian Calendar's dayOfWeek: 7
> ISO Calendar's    getYearOfCentury: 15
> Julian Calendar's getYearOfCentury: 16
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to