Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Pentaho Data Integration Quick Start Guide

You're reading from   Pentaho Data Integration Quick Start Guide Create ETL processes using Pentaho

Arrow left icon
Product type Paperback
Published in Aug 2018
Publisher Packt
ISBN-13 9781789343328
Length 178 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
 Carina Roldán Carina Roldán
Author Profile Icon Carina Roldán
Carina Roldán
Arrow right icon
View More author details
Toc

Running transformations with the Pan utility


So far, you have used Spoon to create and run transformations. However, if you want to run a transformation in a production environment, you won't use Spoon, but a command-line utility named Pan.

Let's quickly look at how to use this tool.

If you browse the PDI installation directory, you will see two versions of the utility: Pan.bat and Pan.sh. You will use the first if you have a Windows environment, and the second for other systems.

Note

In the next step-by-step tutorial, we will assume that you have Windows, but you should make the required adjustments if you have a different system.

 

The simplest way to run a transformation with Pan is to provide the full path of the transformation that you want to run. You can execute Pan in Windows as follows:

Pan.bat /file=<ktr file name>

For Unix, Linux, and other Unix-like systems, use the following command:

./Pan.sh /file=<ktr file name>

Let's suppose that you want to run the first transformation created in this chapter, which is located in the following directory:

c:/pdi_labs/my_first_transformation.ktr

In order to run it, follow these instructions:

  1. Open a Terminal window
  2.  Go to the directory where PDI is installed and type the following code:
       Pan /file=c:/pdi_labs/my_first_transformation.ktr

Note

You must include the full path for the transformation file. If the name contains spaces, surround it with double quotes.

After running the command, you will see the log of the execution, which is the same log that you see in the Execution Results window in Spoon. In order to change the log level, just add the following:

-level:<log level>

The possible values for the log level are Nothing, Minimal, Error, Basic, Detailed, Debug, and Rowlevel.

As an example, the following command will print not only the basic log, but also the details of every row that is being processed:

Pan - level:Rowlevel /file=c:/pdi_labs/my_first_transformation.ktr

 

 

The details of the rows are as follows:

 ...
 2018/06/10 12:33:43 - Sort rows.0 - Read row: [YONKERS], [NY], [10701]
 2018/06/10 12:33:43 - Sort rows.0 - Read row: [YONKERS], [NY], [10703]
 2018/06/10 12:33:43 - Sort rows.0 - Read row: [YONKERS], [NY], [10705]
 2018/06/10 12:33:43 - Sort rows.0 - Read row: [YORKVILLE], [NY], [13495]
 2018/06/10 12:33:43 - Sort rows.0 - Read row: [YULAN], [NY], [12792]
 2018/06/10 12:33:43 - Sort rows.0 - Signaling 'output done' to 0 output rowsets.
 2018/06/10 12:33:43 - Sort rows.0 - Finished processing (I=0, O=0, R=1146, W=1146, U=0, E=0)

In the last version of our transformation, we added a named parameter with the path where PDI had to look for the input file. In Spoon, you provided the value in the Execution window. When running the transformation with Pan, you do it by using the param option, as follows:

/param:<parameter name>=<parameter value>

In our example, supposing that the new value is c:/samples, we build the command-line parameter as follows:

/param:"NAME=c:/samples"

Note

If you want to know all of the possible options for the Pan command, run Pan.bat or Pan.sh without parameters, and all of the options will be displayed.

You have been reading a chapter from
Pentaho Data Integration Quick Start Guide
Published in: Aug 2018
Publisher: Packt
ISBN-13: 9781789343328
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images