Skip to main content Skip to complementary content

Testing a DSQL map

The Test Run feature in DSQL maps allows you to preview and validate the results of your mapping.

Before you begin

You have sample input files in your Sample Data folder. If you created your input structure from a sample file, it should already be there. Otherwise, you can follow the steps in Adding sample data to add a sample file.

Testing a DSQL map with a single input and output

Test your mapping with a single sample input file.

Procedure

  1. In the Test Run view, click Select New Sample Data Select New Sample Data to add the input file to use for testing.
    Information noteTip: You can also add the sample data with a drag and drop.
  2. Enter the name or part of the name of the file and look for it in the Sample Data folder.
    In this example, the file to use is the first result.
    Open Resource window.
  3. Select the file to use and click OK.
  4. Click Execute Test Run Execute Test Run to run the test.
    Information noteNote: You can also store the results on the file system by clicking Execute Test Run to File Execute Test Run to File. You need to select the directory in which you want to store the results and enter a name for the results.

Results

In this example, the test run should return the following result:
{
   "items":[
      {
         "make":"MBIKE",
         "description":"27.5 inch electric mountain bike",
         "price":"899.99 USD"
      },
      {
         "make":"EBIKE",
         "description":"Electric hybrid bike",
         "price":"999.99 USD"
      },
      {
         "make":"WBIKE",
         "description":"Women's road bike",
         "price":"299.99 USD"
      }
   ]
}

Testing an element in a DSQL map

Test a specific element of your mapping with a single sample input file. You can either select a specific main element, an unrolled element or a split element.

Procedure

  1. In the Test Run view, click Select New Sample Data Select New Sample Data to add the input file to use for testing.
    Information noteTip: You can also add the sample data with a drag and drop.
  2. Enter the name or part of the name of the file and look for it in the Sample Data folder.
    In this example, the file to use is the first result.
    Open Resource window.
  3. Select the file to use and click OK.
  4. In the output structure of your mapping, right-click an element, for example description, and click Test Run.

Results

In this example, the test run should return the following result:
{
   "items":[
      {
         "description":"27.5 inch electric mountain bike",
      },
      {
         "description":"Electric hybrid bike",
      },
      {
         "description":"Women's road bike",
      }
   ]
}

Viewing a DSQL map with multiple outputs

When your mapping uses multiple outputs, the Test Run view displays multiple output tabs when you execute a test run. For example, if you have a mapping with two JSON files used as outputs as follows:

Example of a Standard Job with tHMap and two output components.

Results

  • When you click Execute Test Run Execute Test Run to run the test, the test run returns multiple output tabs as follows:
    Example of multiple output tabs in the Test Run view.
Information noteNote: You can also store the results on the file system by clicking Execute Test Run to File Execute Test Run to File. You need to select the directory in which you want to store the results. Each output is then stored separately with a name automatically given from the path of the output elements.

Viewing a DSQL map with multiple inputs

When your mapping uses multiple inputs, the Test Run view displays multiple input tabs. For example, if you have a mapping with two JSON files used a inputs, as follows:

Example of a Standard Job with tHMap and two input components.

Results

  • In the Test Run view, you can find multiple input tabs which each corresponds to the input structure. For example, if your structure contains two inputs, there are two tabs, as follows:
    Example of multiple input tabs in the Test Run view.
Information noteTip: When you right-click the structure, you can click Show sample file to open a preview of the input data.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!