You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Pavel Fedyakov (JIRA)" <ji...@apache.org> on 2014/10/21 18:17:34 UTC

[jira] [Created] (PIG-4244) Side effect of UnixToISO()

Pavel Fedyakov created PIG-4244:
-----------------------------------

             Summary: Side effect of UnixToISO()
                 Key: PIG-4244
                 URL: https://issues.apache.org/jira/browse/PIG-4244
             Project: Pig
          Issue Type: Bug
          Components: piggybank
    Affects Versions: 0.11
            Reporter: Pavel Fedyakov


To reproduce the bug, local timezone should *not* be set to UTC.

Script below produces datetime strings and hour numbers in local timezone:
{code}
in = load 'in' as (ts: long);
out = foreach in generate ToDate(ts), GetHour(ToDate(ts));
dump out;
{code}
(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:
{code}
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;
{code}
(For input 0 result is (1970-01-01T00:00:00.000Z,1970-01-01T00:00:00.000Z,0) on my machine.)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)