Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: Environment Variables in Text File Input doesn't work

  1. #1

    Default Environment Variables in Text File Input doesn't work

    When I set file name as variable in the Text File Input step, it doesn't work and also it doesn't complain. I just see zero rows in my output.
    However I tried to use CSV Input - it works like a charm. But CSV Input is missing some critical functionalities such as Error Handling.

    I have attached a very simple transformation and a input file.

    Do I raise a JIRA for this ?

    Other thing, how do I get error handling features in in CSV Input (I would like to redirect failed records to some file)?

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    Quote Originally Posted by rusang View Post
    I have attached a very simple transformation and a input file.
    mmmm... don't see them

    Quote Originally Posted by rusang View Post
    Do I raise a JIRA for this ?
    Maybe, but first attach the transformation and input. Remember you can't set a variable in the same transformation as where you use it.

    Quote Originally Posted by rusang View Post
    Other thing, how do I get error handling features in in CSV Input (I would like to redirect failed records to some file)?
    Raise a JIRA.

    Regards,
    Sven

  3. #3

    Default

    I am setting variable from Spoon toolbar - Edit-->Set Environment Variable. This is to test it.

    Actually I have embedded transformations in my applications and run headless.

    This is how I do it.
    if(props != null){
    for(Enumeration en = props.propertyNames(); en.hasMoreElements(){
    key = (String)en.nextElement();
    trans.setVariable(key, props.getProperty(key));
    }
    }
    trans.getTransMeta().setInternalKettleVariables(trans);

    // allocate & run the required sub-threads
    ArrayList<String> args = new ArrayList <String>();
    args.add("-file="+transFilename);
    args.add("-logfile="+logfile);
    args.add("-level="+loglevel);
    trans.execute((String[])args.toArray(new String[args.size()]));

    trans.waitUntilFinished();
    trans.endProcessing("end");
    Attached Files Attached Files

  4. #4

    Default

    attached input data.
    Attached Files Attached Files

  5. #5

  6. #6
    Join Date
    May 2006
    Posts
    4,882

    Default

    good example results in a quick fix .

    Fixed in 3.0.2 and 3.1(-M1)

    Regards,
    Sven

  7. #7

    Default

    Cool.

    When are 3.0.2 and 3.1 are planned to be released?

    -rusang

  8. #8
    Join Date
    May 2006
    Posts
    4,882

    Default

    Don't know for sure ... 3.0.2 I heard somewhere end of the week ... 3.1 still has to go through some M and RC releases.

    Regards,
    Sven

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.