Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
0.11
-
None
-
None
Description
To reproduce the bug, local timezone should not be set to UTC.
Script below produces datetime strings and hour numbers in local timezone:
in = load 'in' as (ts: long); out = foreach in generate ToDate(ts), GetHour(ToDate(ts)); dump out;
(For input 0 result is (1970-01-01T03:00:00.000+03:00,3) on my machine.)
If UnixToISO() is called nearby, builtin ToDate() changes output, producing result in UTC timezone:
register piggybank.jar; DEFINE UnixToISO org.apache.pig.piggybank.evaluation.datetime.convert.UnixToISO(); in = load 'in' as (ts: long); out = foreach in generate UnixToISO(ts), ToDate(ts), GetHour(ToDate(ts)); dump out;
(For input 0 result is (1970-01-01T00:00:00.000Z,1970-01-01T00:00:00.000Z,0) on my machine.)