Mappings > Mappings > Data preview in mappings
  

Data preview in mappings

When you create a mapping, you can preview data for individual transformations to test the mapping logic.
You preview data for a transformation on the Preview panel of the transformation. Select the number of source rows to process and the runtime environment that runs the preview job.
When you run a preview job, Data Integration creates a temporary mapping task that contains a virtual target immediately downstream of the selected transformation. Data Integration discards the temporary task after the preview job completes. When the job completes, Data Integration displays the data that is transformed by the selected transformation on the Preview panel.
The following image shows the Preview panel of a Sorter transformation after you run a preview job on the transformation:
The mapping contains Source, Filter, Sorter, and Target transformations. The Sorter transformation is selected, and the Preview panel is displayed. The Preview panel shows the rows of data that have been processed by the Filter and Sorter transformations.
To preview data in a mapping, you must have the Data Integration Data Previewer role or your user role must have the "Data - preview" feature privilege for Data Integration.
If you apply a limit to the number of rows to preview for an active transformation, such as a Filter transformation, that row limit also applies to the source. The Filter transformation might show fewer rows output in the filter preview window than in the source preview window, depending on the filter condition.
You can preview data if the mapping uses input parameters. Data Integration prompts you for the parameter values when you run the preview.
You can't preview data when you develop a mapplet in the Mapplet Designer. You can't preview data that contains special, emoji, and Unicode characters in the table name.

Preview behavior for a mapping

You can preview data for a transformation if there are no mapping validation errors in the selected transformation or any upstream transformations. Data Integration displays mapping results for the selected transformation. It also generates results for the upstream transformations.
You can preview data for any transformation except for the following transformations:

Running a preview job for a mapping

Run a data preview job on the Preview panel of the selected transformation.
Before you run a data preview job for a mapping, verify that the following conditions are true:
To run a data preview job:
    1 In the Mapping Designer, select a transformation.
    2Open the Preview panel.
    3Click Run Preview.
    4 In the Run Preview wizard, enter the number of source rows to preview and the runtime environment to run the preview job.
    The number that you enter applies to each source in the mapping. For example, if you select 10 rows and the mapping contains multiple sources, the preview job processes the first 10 rows in each source.
    You can select up to 999,999,999 rows.
    Warning: Selecting a large number of source rows can cause storage or performance issues on the Secure Agent machine.
    5If the part of the mapping that you are previewing uses input parameters, click Next and enter the parameter values.
    6Click Run Preview.
Data Integration displays the results in the Preview panel for the selected transformation.
You can monitor preview jobs on the My Jobs page in Data Integration and on the All Jobs and Running Jobs pages in Monitor. Data Integration names the preview job <mapping name>-<instance number>, for example, MyMapping_1. You can download the session log for a data preview job. However, session logs for data preview jobs for mappings in SQL ELT mode aren't available for download.
To restart a preview job, run the job again on the Preview panel. You can't restart a data preview job on the My Jobs or All Jobs pages.

Viewing preview results for a mapping

Data Integration generates preview results for the selected transformation and the upstream transformations in the mapping. Data Integration stores preview results in CSV files on the Secure Agent machine.
Data Integration displays preview results on the Preview panel of the selected transformation and each upstream transformation. Data Integration does not display preview results for downstream transformations.
If a transformation has multiple output groups and you want to preview results for a different output group, select the output group from the Output Groups menu at the top of the Preview panel.
To download preview results, click Download on the Preview panel.
Data Integration stores preview results in CSV files on the Secure Agent machine. When you run a preview, Data Integration creates one CSV file for the selected transformation and one CSV file for every upstream transformation in the mapping. If a transformation has multiple output groups, Data Integration creates one CSV file for each output group. If you run the same preview multiple times, Data Integration overwrites the CSV files.
By default, the files are stored in the following directory:
<Secure Agent installation directory>/apps/Data_Integration_Server/data/cache/preview
The CSV files are stored in this directory unless an organization administrator changes the value of the $PMCacheDir property for the Data Integration Server service that runs on the Secure Agent. For more information about Secure Agent services, see the Administrator help.
Note: Ensure that the Secure Agent machine has enough disk space to store preview data for all users that might run a data preview using the Secure Agent.
Data Integration purges the preview directory once every 24 hours. During the purge, Data Integration deletes files that are more than 24 hours old.
Note: In CSV format, null values for integer, double, string, and text data types show as empty.

Customizing preview results

You can choose which columns to display on the Preview panel. You can also reorder the columns. Customize the Preview panel on the Settings dialog.
The following image shows the Settings dialog:
The image shows an Available Columns area on the left and a Selected Columns area on the right. Column names appear in both areas. The column MiscDate is selected in the Selected Columns area. There are directional arrows to move the selected column to the Available Columns on the left, or to move it up or down in the Selected Columns area.
To open the Settings dialog, click the settings icon on the Preview panel. Columns in the Selected Columns area appear on the Preview panel. To hide a column from the Preview panel, select it and move it to the Available Columns area. To reorder the columns in the Preview panel, select a column name in the Selected Columns area and move it up or down.