Saving and running a transformation

The last task before saving and running the transformation is to send the results to a file. This is quite easy:

  1. From the Output folder, drag and drop a Text file output step to the work area. Create a hop from the Sort rows step to this new step. Note that this time, you don't have to choose the kind of hop; a default kind of hop will be created.
  2. Double-click on the Text file output step. In the configuration window, provide a name for the file that we will generate. You should specify the full path, for instance, C:/Pentaho/data/ny_cities.
You don't have to type the extension; it is automatically added, as indicated in the extension textbox.
  1. Close the window.

The transformation is complete. The only task to perform now is to save it and run it, as follows:

  1. Save the transformation. You can do so by pressing Ctrl + S or by selecting the proper option from Main Menu or Main Toolbar.

  1. Once the transformation has saved, you can run it. Do so by pressing F9. In the Logging tab of the Execution Results window, you will see the log of the execution. If you select the Preview data tab in the same window, you will see sample data coming from the step currently selected. As an example, click on the Filter rows step and look at the data in the Preview data tab. You will see all of the rows for the state of NY, although they are still out of order:
Preview data tab
  1. If you click on the Sort rows step, you will see the same, but ordered. Also, a file should have been created with the same information. Browse your system to look for the generated file. Its content should be something like the following: 
     CITY;STATE;POSTALCODE
NEW YORK;NY;10001
NEW YORK;NY;10003
NEW YORK;NY;10005
...
...
ELMIRA;NY;14925
HOLTSVILLE;NY;501
FISHERS ISLAND;NY;6390
If you look at the sample lines, you will note that the code 501 is between 14925 and 6390. The codes are not sorted by number, but alphabetically. This is because the ZIP code was defined as a String in the input step.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset