Package org.apache.pig.piggybank.evaluation.datetime.convert

Class Summary
CustomFormatToISO CustomFormatToISO converts arbitrary date formats to ISO format.
ISOToUnix ISOToUnix converts ISO8601 datetime strings to Unix Time Longs Jodatime: http://joda-time.sourceforge.net/ ISO8601 Date Format: http://en.wikipedia.org/wiki/ISO_8601 Unix Time: http://en.wikipedia.org/wiki/Unix_time Example usage: REGISTER /Users/me/commiter/piggybank/java/piggybank.jar ; REGISTER /Users/me/commiter/piggybank/java/lib/joda-time-1.6.jar ; DEFINE ISOToUnix org.apache.pig.piggybank.evaluation.datetime.convert.ISOToUnix(); ISOin = LOAD 'test.tsv' USING PigStorage('\t') AS (dt:chararray, dt2:chararray); DESCRIBE ISOin; ISOin: {dt: chararray,dt2: chararray} DUMP ISOin; (2009-01-07T01:07:01.000Z,2008-02-01T00:00:00.000Z) (2008-02-06T02:06:02.000Z,2008-02-01T00:00:00.000Z) (2007-03-05T03:05:03.000Z,2008-02-01T00:00:00.000Z) ...
UnixToISO UnixToISO converts Unix Time Long datetimes to ISO8601 datetime strings Jodatime: http://joda-time.sourceforge.net/ ISO8601 Date Format: http://en.wikipedia.org/wiki/ISO_8601 Unix Time: http://en.wikipedia.org/wiki/Unix_time Example usage: REGISTER /Users/me/commiter/piggybank/java/piggybank.jar ; REGISTER /Users/me/commiter/piggybank/java/lib/joda-time-1.6.jar ; DEFINE UnixToISO org.apache.pig.piggybank.evaluation.datetime.convert.UnixToISO(); UnixIn = LOAD 'test2.tsv' USING PigStorage('\t') AS (dt:long); DESCRIBE UnixIn; UnixIn: {dt: long} DUMP UnixIn; (1231290421000L) (1233885962000L) (1236222303000L) toISO = FOREACH UnixIn GENERATE UnixToISO(dt) AS ISOTime:chararray; DESCRIBE toISO; toISO: {ISOTime: chararray} DUMP toISO; (2009-01-07T01:07:01.000Z) (2009-02-06T02:06:02.000Z) (2009-03-05T03:05:03.000Z) ...
 



Copyright © ${year} The Apache Software Foundation