官术网_书友最值得收藏!

Time for action – running the matches transformation from a terminal window

Let's suppose that the name of your transformation is matches.ktr. In order to run the transformation from a terminal, follow these instructions:

  1. Open a terminal window, and go to the directory where Kettle is installed. If your system is Windows, and supposing that Kettle is installed in C:\pdi-ce, type:
    C:\pdi-ce>Pan.bat /file=c:\pdi_labs\matches.ktr europe_201210.txt
  2. On Unix, Linux, and other types of systems, supposing that Kettle is installed under /home/your_dir/pdi-ce/, type:
    /home/your_dir/pdi-ce/pan.sh /file=/home/your_dir/pdi_labs/matches.ktr europe_201210.txt
  3. If your transformation is in another folder, modify the command accordingly.
  4. While the transformation runs you will be able to see the progress in the terminal:
  5. Check the output file. The contents of europe_201210.txt should be at the end of the matches.txt file.

What just happened?

You executed a transformation with Pan, the program that runs transformations from terminal windows. As a part of the command you specified the full path of the transformation file and provided the name of the file to process, which was the only argument expected by the transformation. As a result, you got the same output as if you had run the transformation from Spoon: a small file appended to the global file.

When you are designing transformations, you run them with Spoon; you don't use Pan. Pan is mainly used as part of batch processes, for example, processes that run every night in a scheduled fashion.

Note

Appendix B, Pan and Kitchen – Launching Transformations and Jobs from the Command Line gives you all the details about using Pan.

Have a go hero – finding out system information

Create a transformation that writes to the log the following information:

  • System date
  • Information about Kettle: version, build version, and build date
  • Name of the transformation you're running

Run the transformation both from Spoon and from a terminal window.

主站蜘蛛池模板: 山东| 阿坝| 武安市| 洪江市| 内黄县| 南宁市| 柞水县| 西昌市| 平陆县| 东阳市| 来安县| 长阳| 徐闻县| 北票市| 商丘市| 惠州市| 城市| 都江堰市| 乌拉特后旗| 平度市| 曲麻莱县| 济南市| 重庆市| 宝鸡市| 平乐县| 临朐县| 宝清县| 额尔古纳市| 绥滨县| 固阳县| 浙江省| 永平县| 钟山县| 天水市| 武陟县| 太仓市| 黎平县| 连城县| 姜堰市| 泰兴市| 宜都市|