AddDuration returns the result of a DateTime object plus a Duration object
- Jodatime: http://joda-time.sourceforge.net/
- ISO8601 Duration Format: http://en.wikipedia.org/wiki/ISO_8601#Durations
Example usage:
ISOin = LOAD 'test.tsv' USING PigStorage('\t') AS (dt:datetime, dr:chararray);
DESCRIBE ISOin;
ISOin: {dt: datetime,dr: chararray}
DUMP ISOin;
(2009-01-07T01:07:01.000Z,PT1S)
(2008-02-06T02:06:02.000Z,PT1M)
(2007-03-05T03:05:03.000Z,P1D)
...
dtadd = FOREACH ISOin GENERATE AddDuration(dt, dr) AS dt1;
DESCRIBE dtadd;
dtadd: {dt1: datetime}
DUMP dtadd;
(2009-01-07T01:07:02.000Z)
(2008-02-06T02:07:02.000Z)
(2007-03-06T03:05:03.000Z)