Reputation: 123
Pentaho stores files created by job or transformation under /data-integration folder. Do you know the variable which I can overwrite and save my files under other directory?
Upvotes: 1
Views: 1846
Reputation: 6356
The PDI solution for this is to define the filename as ${my_dir}/my_file
,
where my_dir
is a variable to be replaced at runtime by its value.
To define a variable, right-click anywhere in spoon main screen to bring the dropmenu, select Properties
then Parameters
, and add my-dir
in the table, optionally with a default value.
When you run the job/transformation, you are presented a table of parameters, among which my_dir
, to you have the opportunity to change the default.
There are many others ways to define a variable. For example, the Set variable
/ Get Variable
let you change the variable from transformation to transformations in a job.
An other (very) usefull way is to define the variable in the kettle.properties
that you can access from the main menu/edit/
and is staranard file in the .kettle
directory in c:\User\yourname\
(Windows) directory or you installation directory (linux). The properties will overwrite the default values at runtime. The magic of this approach is that you can have a kettle.properties
on your dev-machine, different from the one on the prod-server or the ones of your co-workers. A pretty handy solution especially for databases and url connections and passwords.
There is much more to say, because the PDI machinery goes ways further than rewriting an environment variable (which I guess is ${user.dir}
).
And one more thing: you can popup a selectable list of variables almost anywhere it makes sense by pressing Crtl+Space.
Upvotes: 1