Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: How to execute a transformation with a different locale

  1. #1

    Question How to execute a transformation with a different locale

    Hi,

    I need to parse XML files which contains date with EEE, d MMM yyyy HH:mm:ss Z format with US locale without impact Spoon, Kitchen ...

    I use get data from XML transformation.
    In the fields tab, the field is defined as a date and the format EEE, d MMM yyyy HH:mm:ss Z
    Spoon and others tools are launched with default locale (FR) and the transformation failed
    011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : org.pentaho.di.core.exception.KettleValueException:
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : created String : couldn't convert string [Wed, 16 Feb 2011 10:46:17 +0100] to a date using format [E, d MMM yyyy HH:mm:ss Z]
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Unparseable date: "Wed, 16 Feb 2011 10:46:17 +0100"
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Unexpected error
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : org.pentaho.di.core.exception.KettleException:
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Unable to read row from XML file
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) :
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : org.pentaho.di.core.exception.KettleValueException:
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : created String : couldn't convert string [Wed, 16 Feb 2011 10:46:17 +0100] to a date using format [E, d MMM yyyy HH:mm:ss Z]
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Unparseable date: "Wed, 16 Feb 2011 10:46:17 +0100"
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) :
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) :
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) :
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : at org.pentaho.di.trans.steps.getxmldata.GetXMLData.getXMLRowPutRowWithErrorhandling(GetXMLData.java:720)
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : at org.pentaho.di.trans.steps.getxmldata.GetXMLData.getXMLRow(GetXMLData.java:691)
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : at org.pentaho.di.trans.steps.getxmldata.GetXMLData.processRow(GetXMLData.java:648)
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : at org.pentaho.di.trans.step.RunThread.run(RunThread.java:40)
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : at java.lang.Thread.run(Thread.java:662)
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Caused by: org.pentaho.di.core.exception.KettleException:
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : org.pentaho.di.core.exception.KettleValueException:
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : created String : couldn't convert string [Wed, 16 Feb 2011 10:46:17 +0100] to a date using format [E, d MMM yyyy HH:mm:ss Z]
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Unparseable date: "Wed, 16 Feb 2011 10:46:17 +0100"
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) :
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) :
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : at org.pentaho.di.trans.steps.getxmldata.GetXMLData.processPutRow(GetXMLData.java:888)
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : at org.pentaho.di.trans.steps.getxmldata.GetXMLData.getXMLRowPutRowWithErrorhandling(GetXMLData.java:716)
    2011/11/21 12:00:17 - PARSE XML ENT ISSUES.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : ... 4 more
    Up to now, I force Locale from commande line : add "-Duser.language=en" "-Duser.region=EN" to PENTAHO_DI_JAVA_OPTIONS var

    Is there any tips cleaner ?

    I've tried by modified
    variables, arguement, parameter's transformation. But that doesn't work.

    Techs
    PDI 4.2.1
    JDK 1.6_25
    Cheers

    F.P.

  2. #2
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    You can do it in JavaScript (one of the exceptions):

    Code:
    str2date(created, "E, d MMM yyyy HH:mm:ss Z", "EN", "CET");
    HTH,

    Matt

    Parse localized date string with timezone.ktr

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.