- Instant Pentaho Data Integration Kitchen
- Sergio Ramazzina
- 665字
- 2021-08-13 16:35:11
How to do it...
- Create a new empty job. To do this, you can perform either of the following steps:
- Click on the New button from the toolbar menu and select the Job item entry
- Select the Job item entry by navigating to File | New or by pressing Ctrl + ALT + N.
- Go to the Job settings dialog and define a new parameter called
p_country
. Do this as follows:- Open the Job settings dialog by either pressing Ctrl + J or right-clicking on any place of the right working area and selecting Job settings from the newly displayed contextual menu.
- Once the dialog opens, select the Parameters tab and add a new parameter called
p_country
. - Select the Design tab from the left-hand side view to display the list of tasks from their corresponding category folders. Look for the following tasks and drag-and-drop them into the working area on the right:
- From the General category folder, get a Start task and a Transformation task and drag-and-drop them into the working area.
- From the File management category folder, get a Delete File task and drag-and-drop it into the working area.
- From the Utility category folder, get an Abort task and drag-and-drop it into the working area on the right.
- Connect the tasks together in the following specified order:
- Connect the Start task to the Delete File task.
- Connect the Delete File task to the Transformation task and then connect the Delete File task to the Dummy task as well.
- Connect the Transformation task to the Success task and then connect the Transformation task to the Dummy task as well.
- Connect the Dummy task to the Abort task.
- Configure the Delete File task as follows:
- Open the Delete File task properties dialog by either double-clicking on the step icon in the working area or right-clicking on the step icon and selecting Edit job entry.
- Configure the name of the task.
- Configure the name of the file to be deleted by typing the complete name of the file in the Filename input field. The file to be deleted is located in the same samples directory where the transformation and the job reside. In any case, a good approach is to type the filename in a way that is location independent, using a system variable to parameterize the directory name where the file is located. In our case, the complete filename is
${Internal.Transformation.Filename.Directory}/selected_country_customers.xls
. - As you can see in the Properties dialog, you can tick a checkbox so that the task will fail in case the file to be deleted does not exist.
- Click on OK and close the Delete File task properties dialog.
- Configure the Transformation task as follows:
- Open the Transformation task properties dialog by either double-clicking on the step icon in the working area or right-clicking on the step icon and selecting Edit job entry.
- Configure the name of the task.
- Under the Transformation specification tab, configure the name of the file for the transformation we're going to call. The transformation's file is located in the same samples directory where the job resides. In any case, a good approach is to type the filename in a way that is location independent, using a system variable to parameterize the directory name where the file is located. In our case, the complete filename is
${Internal.Job.Filename.Directory}/read-customers.ktr
. - Save the job with the suggested name,
export-job.kjb
, in the same directory where you previously saved the transformation. - Try to execute the processes from the Spoon GUI. This is normally done by the developer to test or debug his/her jobs and transformations. To do this, click on the Run button, which can be identified by the green triangle icon located in the toolbar.
- After the execution, if anything gets terminated successfully, the task icons will be decorated by a green mark that indicates that the specific tasks were executed successfully. Moreover, down in the working area, the Job Entry log details view indicates the results for every single task called by the job.
推薦閱讀
- iOS 9 Game Development Essentials
- OpenCV 3和Qt5計算機視覺應用開發
- PHP+Ajax+jQuery網站開發項目式教程
- 深入剖析Java虛擬機:源碼剖析與實例詳解(基礎卷)
- LabVIEW虛擬儀器入門與測控應用100例
- TMS320LF240x芯片原理、設計及應用
- C語言程序設計實訓教程與水平考試指導
- BeagleBone Robotic Projects(Second Edition)
- UML2面向對象分析與設計(第2版)
- Python第三方庫開發應用實戰
- Ionic3與CodePush初探:支持跨平臺與熱更新的App開發技術
- C語言程序設計
- Web程序設計與架構
- Neo4j權威指南 (圖數據庫技術叢書)
- Hands-On Game Development Patterns with Unity 2019