Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Can't pull variables from job in transformation

  1. #1
    Join Date
    Jul 2017
    Posts
    3

    Default Can't pull variables from job in transformation

    Running into some frustration trying to pull variables from the parent job within a child transformation.

    PDI version 7.1.0.0-12, build 1 from 2017-05-16 17.18.02
    OSX Sierra 10.12.5

    Basic parent job flow
    Spoon_-_ETL.jpg

    Variable I am setting in 'Set Variables'
    Set_variables___.jpg

    The variables list window within a child transformation step
    Table_input_and_Spoon_-_Users.jpg

    Two issues I'm running into:

    1. I don't see the variable in my child transformation? What gives?
    2. I don't see the variable in my parent job either UNTIL I run the job at least once. THEN it shows up.


    I'd like to stick to using 'set variables' so job parameters is not an option at this time. Can anyone provide a little more insight as to what's going on?

    Thanks

  2. #2
    Join Date
    Apr 2008
    Posts
    4,449

    Default

    If you know the name of your variable, you can simply use it in your transform.
    You are fighting with Design Time vs Run Time.

    Things that only exist at Run Time can't be displayed at Design Time.
    You can work around this a little bit in Spoon by going to the Edit menu and selecting "Set Environment Variables" and setting one to the same name as the variable you are setting in your Job.

  3. #3
    Join Date
    Jul 2017
    Posts
    3

    Default

    Makes sense. Although would be nice to be able to see design time variables show up. I wasn't able to get it working when typing in the variable manually. But with your confirmation that it should work, I dug around more and found that I was not checking the "Replace variables in script?" checkbox in the "Table Input" step. I would think something like that should be active by default.

    I ended up adding the variables in the kettle.properties file for design purposes but "Set Environment Variables" seems like a good method for future.

    Thanks for help.


    Quote Originally Posted by gutlez View Post
    If you know the name of your variable, you can simply use it in your transform.
    You are fighting with Design Time vs Run Time.

    Things that only exist at Run Time can't be displayed at Design Time.
    You can work around this a little bit in Spoon by going to the Edit menu and selecting "Set Environment Variables" and setting one to the same name as the variable you are setting in your Job.

  4. #4
    Join Date
    Apr 2008
    Posts
    4,449

    Default

    It's not on by default since it does incur a slight performance penalty.
    And really, everybody cares about performance first, right?

  5. #5
    Join Date
    Jul 2017
    Posts
    3

    Default

    At run time, sure. But seems like something that could be checked and toggled at design time. I don't believe there's any usage of ${} in SQL so should be easily parsable to determine if "variables" should be on.

    Quote Originally Posted by gutlez View Post
    It's not on by default since it does incur a slight performance penalty.
    And really, everybody cares about performance first, right?

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 - 2017 Pentaho Corporation. All Rights Reserved.