Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-4115

Timezone inconsistency in Pig Oozie action fails with "(org.apache.pig.builtin.ToDate2ARGS)[datetime]"

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.12.0
    • None
    • None
    • None

    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.

      ...
      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) 
      ...
      

      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

      Attachments

        Activity

          People

            rohini Rohini Palaniswamy
            michalisk Michalis Kongtongk
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: