In this post we will see the basics on how to work with command line arguments in Kettle ETL.
Software setup :
Kettle 5.2.0.0 CE
Quick points to Navigate through this post :
1) Command Line Arguments - definition & points
2) Ways to work with Command line arguments
1) From command line
2) From Kettle GUI
3) Example : With Transformation
Scenario : Store argument values(Strings) in a text file
4) Example : With Job
Scenario : Store argument values(Strings) in a text file5) Download section
Download Example here : Click Me..!!!
Download pdf version of the same article here : Click Me...!!!!
Go to "download" tab of this site to get the documents topic wise.
1) Command Line Arguments :
Command line
Arguments
|
* A named, user-supplied, single-value input.
* Each transformation or job can have a max of 10 arguments.
* It is declared as space-separated values given after the Pan or Kitchen line
* Arguments could be numbers, words (strings), or variables
(system or script variables, not PDI variables). |
Reference
| |
Blog Reference
|
2) There are 2 ways to work with command line arguments
1) From command line
2) From Kettle GUI
1) From command line
Command line arguments syntax with transformation
Command line arguments examples with transformations
Command line arguments syntax with jobs
Command line arguments examples with jobs
2) From Kettle GUI
l Arguments can be handled at the time of execution of transformation or job.
l In Transformation : At “Execute a Transformation” dialogue window
l Job : At “Excute a Job” dialogue window.
3) Example : With Transformation
Scenario : Store argument values(Strings or numbers) in a text file
1) Take a new Transformation(Ctrl+N) save it as 1_CommandLineArgumentsBasic.ktr
2) Drag and drop “Get System Info” step from “Input” category.
3) Double click on it get it properties window as shown in below image and Type 3 filed names
as Arg1,Arg2 and Arg3 and give type as command line argument1 and 2 and 3.
4) Take a “Text output file” from “Output” category and connect it from “Get Sys Info” step.
5) Give file path= E:\Explore\Kettle and file name =CommanLineArgumentsOutput and say
its type = text .. Go to “Fields” tab and click on “Get Fields” button to get the fields coming from “Get System Info” step.
|
No comments:
Post a Comment