0

While developing transformations on local I set my transformation path to the target folders that are presented in Local PC and Once testing is completed on local I am moving our transformation to server repository to schedule it from server environments but every time I require to change the path set to the server folders. I believe it can be done by creating dynamic path or creating any variable but I am unable to resolve it. Is this option available in Pentaho? if Yes, Can you please help me for setting the dynamic path?

SUNITH
  • 15
  • 10

2 Answers2

0

In This answer there is a link to a described solution, and in the answer i have a sample KTR that should help.

You can also use the pentaho properties file in different environments, meaning, you can utilize the same variable in both environments, say ${path}, but in each environment this has a different value.

kettle.properties can be found in your user folder .. C:\Users\YourUser.kettle

Cristian Curti
  • 1,004
  • 1
  • 7
  • 13
0

The standard way to handle environments in Kettleis with variables.

In the home directory there is a (hidden) folder named .kettle which contains every thing that should be local : your preferences, your shared connections, your cache, and, most of all, THE kettle.property file.

You can define variables in it, like a ${myPath}. To do this, use the menu Edit/Edit the Kettle.properties and add a variable named myPath and give it for value your prefered path, with an optional description.

Then, when you see a blue diamond with a $ on the right of a field in a step window (which means almost any field you'll need), you can press Crtl+Enter in the field and choose any variable defined in your kettle.properties. Alternatively, you may type or copy/paste ${your-variable-name} in the field.

Then, when launching spoon, it will not use the hard-coded path, but the content of the variable in the kettle.properties.

And nothing prevent you from having a different kettle.properties on your dev PC and on the prod server.

While we are there, three usefull tricks.

  • There is a predefined ${Internal.Job.Filename.Directory} variable contaning the path of the current transformation which by used for relative path. For example, ${Internal.Job.Filename.Directory}/../myDir/myFile.ext.

  • If you right-click anywhere on the screen, and go to the Properties/Parameters, you may also define your variable here.

  • You may also redefine these variables in the Run Option window that anoys you each time you rune a transformation (yes, there was a reason).

  • Finally, you can send these variables from job to jobs and transfos.

enter image description here

AlainD
  • 6,187
  • 3
  • 17
  • 31