pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michalis Kongtongk (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (PIG-4115) Timezone inconsistency in Pig Oozie action fails with "(org.apache.pig.builtin.ToDate2ARGS)[datetime]"
Date Mon, 11 Aug 2014 11:37:11 GMT

     [ https://issues.apache.org/jira/browse/PIG-4115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michalis Kongtongk updated PIG-4115:
------------------------------------

    Description: 
Running a Pig Action in Oozie : 


CentOS
- mv /etc/localtime /etc/localtime.mv #backup your current tz
- ln -sf /usr/share/zoneinfo/Europe/Zurich /etc/localtime # set tz to Europe/Zurich

- create a hdfs://tmp/file.txt in hdfs with content "1"
In Pig do:
A = load '/tmp/file.txt' as (a:chararray);
B = foreach A generate *, ToDate('02/11/1940', 'dd/MM/yyyy') ;
dump B;


In Oozie Pig Action, 
produce the same script in in workflow.xml and execute
this is where it'll fail.

{code}
...
ERROR 0: Exception while executing [POUserFunc (Name: POUserFunc(org.apache.pig.builtin.ToDate2ARGS)[datetime]
- scope-254 Operator Key: scope-254) children: null at []]: 
java.lang.IllegalArgumentException: Cannot parse "02/11/1940": Illegal instant due to time
zone offset transition (Europe/Zurich) 
...
{code}

Since Oozie is using Pig as a library, I believe they should behave the same.

We notice this inconsistency, when the OS is set to
$ date +%Z # timezone name 
CEST 


  was:
Running a Pig Action in Oozie : 

create a file.txt in hdfs with content "1"
In Pig do:
A = load '/path/to/file.txt' as (a:chararray);
B = foreach A generate *, ToDate('02/11/1940', 'dd/MM/yyyy') ;
dump B;


In Oozie Pig Action, 
produce the same script in in workflow.xml and execute
this is where it'll fail.

{code}
...
ERROR 0: Exception while executing [POUserFunc (Name: POUserFunc(org.apache.pig.builtin.ToDate2ARGS)[datetime]
- scope-254 Operator Key: scope-254) children: null at []]: 
java.lang.IllegalArgumentException: Cannot parse "02/11/1940": Illegal instant due to time
zone offset transition (Europe/Zurich) 
...
{code}

Since Oozie is using Pig as a library, I believe they should behave the same.

We notice this inconsistency, when the OS is set to
$ date +%Z # timezone name 
CEST 



> Timezone inconsistency in Pig Oozie action fails with "(org.apache.pig.builtin.ToDate2ARGS)[datetime]"
> ------------------------------------------------------------------------------------------------------
>
>                 Key: PIG-4115
>                 URL: https://issues.apache.org/jira/browse/PIG-4115
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.12.0
>            Reporter: Michalis Kongtongk
>            Assignee: Rohini Palaniswamy
>
> Running a Pig Action in Oozie : 
> CentOS
> - mv /etc/localtime /etc/localtime.mv #backup your current tz
> - ln -sf /usr/share/zoneinfo/Europe/Zurich /etc/localtime # set tz to Europe/Zurich
> - create a hdfs://tmp/file.txt in hdfs with content "1"
> In Pig do:
> A = load '/tmp/file.txt' as (a:chararray);
> B = foreach A generate *, ToDate('02/11/1940', 'dd/MM/yyyy') ;
> dump B;
> In Oozie Pig Action, 
> produce the same script in in workflow.xml and execute
> this is where it'll fail.
> {code}
> ...
> ERROR 0: Exception while executing [POUserFunc (Name: POUserFunc(org.apache.pig.builtin.ToDate2ARGS)[datetime]
- scope-254 Operator Key: scope-254) children: null at []]: 
> java.lang.IllegalArgumentException: Cannot parse "02/11/1940": Illegal instant due to
time zone offset transition (Europe/Zurich) 
> ...
> {code}
> Since Oozie is using Pig as a library, I believe they should behave the same.
> We notice this inconsistency, when the OS is set to
> $ date +%Z # timezone name 
> CEST 



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

Mime
View raw message