Work with transformations
In the PDI client (Spoon), you can develop transformations, which are data workflows representing your ETL activities. The steps used in your transformations define the individual ETL activities. The transformations containing your steps are stored in KTR files. You can access these KTR files through the PDI client.
Open a transformation
The method you use to open an existing transformation depends on if you are using PDI locally on your machine or if you are connected to a repository. If you are connected to a repository, then you are remotely accessing your file on the Pentaho Server. Optionally, you can open a transformation on a Virtual File System (VFS).
If you recently had a file open, you can also use
.On your local machine
Procedure
In the PDI client, perform one of the following actions:
- Select .
- Click the Open file icon in the toolbar.
- Click the OPEN Files tile from the Welcome screen.
- Hold down the CTRLO keys.
Select the file from the Open window, then click Open.
NoteBy default, the folder from where the last file was accessed is opened.
Results
In the Pentaho Repository
Procedure
Verify that you are connected to a repository, which establishes remote access to the Pentaho Server.
In the PDI client, perform one of the following actions to access the Open repository browser window:
- Select .
- Click the Open file icon in the toolbar.
- Click the OPEN Files tile from the Welcome screen.
- Hold down the CTRLO keys.
NoteBy default, the folder from where the last file was accessed is opened.To use a recently opened file, use the Recents option to navigate to your transformation.
Use either the search box to find your transformation, or use the left panel to navigate to a repository folder containing your transformation.
NoteIf the PDI is already connected to the Pentaho Repository, then only the Recents and Pentaho Repository options appear in the left pane. If the PDI is not connected to a Pentaho Repository, then the following options appear in the left pane:- Recents
- Local
- VFS Connections
- Hadoop Clusters
If you are not connected to Pentaho Repository, then perform one of the following actions to access the transformation:
- Double-click on your transformation.
- Select it and press the Enter key.
- Select it and click Open.
If you are connected to the Pentaho Repository, click Open to access the transformation.
Results
On Virtual File Systems
From the menu bar in the PDI client, select Connecting to Virtual File Systems for details.
to open a PDI transformation on a Virtual File System (VFS). SeeRename a folder
You can rename a folder from the Open. You can rename a folder or file only if you are not connected to the Pentaho Repository.
Procedure
Select a folder or file in the Open window.
Right-click on it.
Select the Rename option from the context menu to rename it.
Save a transformation
The method you use to save a transformation depends on if you are using PDI locally on your machine or if you are connected to a repository. If you are connected to a repository, you are remotely saving your file on the Pentaho Server. Optionally, you can save a transformation on a Virtual File System (VFS) if you are not connected to the Pentaho Repository.
On your local machine
Procedure
In the PDI client, perform one of the following actions:
- Select or .
- Click the Save current file icon in the toolbar.
- Hold down the CTRLS keys.
Specify the transformation's name in the window and select the location.
By default, the folder from where the last file was accessed is opened.
NoteThe file types allowed are .ktr or.kjb.Click Save.
The transformation is saved.
Results
In the Pentaho Repository
Procedure
Verify that you are connected to a repository, which establishes remote access to the Pentaho Server.
In the PDI client, perform one of the following actions:
- Select or .
- Click the Save current file icon in the toolbar.
- Hold down the CTRLS keys.
NoteThe file types allowed are .ktr or.kjb.Navigate to the repository folder where you want to save your transformation.
Specify the transformation's name in the File name field.
Click Save.
Results
On Virtual File Systems
From the menu bar in the PDI client, select Connecting to Virtual File Systems for details.
to save a PDI transformation on a Virtual File System (VFS). SeeRun your transformation
After creating a transformation as a network of steps (a data workflow) that performs your ETL tasks, you should run it in the PDI client to test how it performs in various scenarios. With the Run Options window, you can apply and adjust different run configurations, options, parameters, and variables.
When you are ready to run your transformation, you can perform any of the following actions to access the Run Options window:
- Click the Run icon on the toolbar.
- Select Run from the Action menu.
- Press F9.
The Run Options window appears.
In the Run Options window, you can specify a Run configuration. To set up run configurations, see Run configurations .
The Run Options window also lets you specify logging and other options, or experiment by passing temporary values for defined parameters and variables during each iterative run.
Always show dialog on run is set by default. You can deselect this option if you want to use the same run options every time you execute your transformation. After you have selected to not Always show dialog on run, you can access it again through the dropdown menu next to the Run icon in the toolbar, through the Action main menu, or by pressing F8.
After running your transformation, you can use the Execution panel to analyze the results.
Run configurations
Some ETL activities are lightweight, such as loading in a small text file to write out to a database or filtering a few rows to trim down your results. For these activities, you can run your transformation locally using the default Pentaho engine. Some ETL activities are more demanding, containing many steps calling other steps or a network of transformation modules. For these activities, you can set up a separate Pentaho Server dedicated for running transformations using the Pentaho engine. Other ETL activities involve large amounts of data on network clusters requiring greater scalability and reduced execution times. For these activities, you can run your transformation using the Spark Submit job entry.
You can create or edit run configurations through the Run configurations folder in the View tab as shown below:
To create a new run configuration, right-click on the Run configurations folder and select New. To edit or delete a run configuration, right-click on an existing configuration.
Selecting New or Edit opens the Run configuration dialog box that contains the following fields:
Field | Description |
Name | Specify the name of the run configuration. |
Description | Optionally, specify details of your configuration. |
Select an Engine
You can select the Pentaho Engine to run transformations in the default Pentaho (Kettle) environment.
You can also use the Spark Submit job entry to run big data transformations on your Hadoop cluster to coordinate large amounts of data over multiple nodes. See Spark Submit for details.
Pentaho Engine
The Pentaho engine does not execute sub-transformations or sub-jobs when you select the Pentaho server or Slave server option. If you want to run a sub-transformation on the same server where your parent job runs, select Local for the Run Configuration type.
The Settings section of the Run configuration dialog box contains the following options when Pentaho is selected as the Engine for running a transformation:
Option | Description |
Local | Select this option to use the Pentaho engine to run a transformation on your local machine. |
Pentaho server | Select this option to run your transformation on the Pentaho Server. This option only appears if you are connected to a Pentaho Repository. |
Slave server | Select this option to send your transformation to a slave (remote) server or Carte cluster. |
Location |
If you select Slave server, specify its location. If you have set up a Carte cluster, you can specify Clustered. See Use Carte Clusters for more details. |
Send resources to the server | If you specified a remote server for your remote Location, select to send your transformation to the specified server before running it. Select this option to run the transformation locally on the server. Any related resources, such as other referenced files, are also included in the information sent to the server. |
Log remote execution locally | If you specified Clustered for your remote Location, select to show the logs from the cluster nodes. |
Show transformations | If you specified Clustered for your remote Location, select to show the other transformations that are generated when you run on a cluster. |
Options
Errors, warnings, and other information generated as the transformation runs are stored in logs. You can specify how much information is in a log and whether the log is cleared each time through the Options section of this window. You can also enable safe mode and specify whether PDI should gather performance metrics. Logging and performance monitoring describes the logging methods available in PDI.
Option | Description |
Clear log before running | Indicates whether to clear all your logs before you run your transformation. If your log is large, you might need to clear it before the next execution to conserve space. |
Log level | Specifies how much logging is performed and the amount of
information captured:
|
Enable safe mode | Checks every row passed through your transformation and ensure all layouts are identical. If a row does not have the same layout as the first row, an error is generated and reported. |
Gather performance metrics | Monitors the performance of your transformation execution through these metrics. Use performance graphs shows how to visually analyze these metrics. |
Parameters and Variables
You can temporarily modify parameters and variables for each execution of your transformation to experimentally determine their best values. The values you enter into these tables are only used when you run the transformation from the Run Options window. The values you originally defined for these parameters and variables are not permanently changed by the values you specify in these tables.
Value Type | Description |
Parameters | Set parameter values pertaining to your transformation during runtime. A
parameter is a local variable. The parameters you define while creating your
transformation are shown in the table under the Parameters
tab.
|
Variables | Set values for user-defined and environment variables pertaining to your transformation during runtime. |
Adjust transformation properties
You can adjust the parameters, logging options, dates, dependencies, monitoring, settings, and data services for transformations. To view the transformation properties, click the CTRLT or right-click on the canvas and select Properties from the menu that appears.
Use the transformation menu
Right-click any step in the transformation canvas to view the Transformation menu.
Stop your transformation
There are two different methods you can use to stop transformations running in the PDI client. The method you use depends on the processing requirements of your ETL task. Most transformations can be stopped immediately without concern. However, since some transformations are ingesting records using messaging or streaming data, such incoming data may need to be stopped safely so that the potential for data loss is avoided.
To stop a transformation running in the PDI client:
- Use Stop if your ETL task should stop processing all data immediately.
- Use Stop input processing if your ETL task needs to finish any records already initiated or retrieved before stopping.