# tHMap

Information noteNote: This component is not shipped with your Talend Studio by default. To use it, you need to install the Data Mapper &gt; Talend Data Mapper feature using the Feature Manager. For more information, see [Installing features using the Feature Manager](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/install-features-to-talend-studio).

Executes transformations (called maps) between different sources and destinations by harnessing the capabilities of Talend Data Mapper, available in the Mapping perspective.

tHMap transforms data from a wide range of sources to a wide range of destinations, including support for multiple inputs and multiple outputs. If you want to use multiple inputs, you must use Talend Data Mapper I/O functions. For more information, see [Input/Output expressions](https://help.qlik.com/talend/r/en-US/8.0/data-mapper-user-guide/input-output-expressions).

## tHMap Standard properties

These properties are used to configure tHMap running in the Standard Job framework.

The Standard tHMap component belongs to the Processing family.

This component is available in Talend Data Management Platform, Talend Big Data Platform, Talend Real-Time Big Data Platform, Talend Data Services Platform and in Talend Data Fabric.

## Basic settings

| Properties | Description |
| --- | --- |
| Open Map Editor | Click the [...] button<br>to open the Structure Generate/Select<br>wizard.<br><br>You can first select the type of map to create:<br><br><ul> <li><span>Standard Map</span>: Map that perform mappings using                                functions based on xQuery</li> <li><span>DSQL Map</span>: Map that performs mappings using                                    <span>Data Shaping Query Language</span>.</li> </ul><br><br><br>You can select the Don't ask me again check box<br>to save this preference. For more information about these map types, see<br>[Working with maps](https://help.qlik.com/talend/r/en-US/8.0/data-mapper-user-guide/working-with-maps).<br><br>Information noteNote: This option is available only if you have installed the<br>R2023-10 Studio monthly update or a later one delivered by Talend. For more information, check with your administrator.<br><br>Then you can either have the hierarchical mapper structure generated<br>automatically based on the schema, or select an existing hierarchical mapper<br>structure. You must do this for both the input and output sides of your Map.<br>The following lists the options for the output structure:<br><br><ul> <li> <span>Generate hierarchical mapper structure based on the                                    schema</span> option: When you connect multiple output                                connections to the tHMap, the page displays a confirmation message                                that informs you that the mapper structures are generated based on                                the output connections.</li> <li> <span>Select an existing hierarchical mapper                                    structure</span> option: You can connect multiple outputs                                that are payload-based connections to the tHMap. If there is a                                single payload-type connection, you can select the <span>Allow                                    support for multiple output connections</span> check box.                                The generated output map inherits from the existing payload                                structure.</li> </ul><br><br>If Talend Studio detects multiple output connections available, the window displays both<br>output structure options without the support for multiple output connections<br>check boxes.<br><br>If neither input nor output connection exists, the Structure Selection page<br>is displayed. |
| Synchronize map with schema connections | Select this check box if you want to automatically regenerate<br>your map's input and output structures after one of the following changes:<br><br><ul> <li>Connection metadata change</li> <li>Input or output connection added</li> <li>Input or output connection removed</li> </ul><br><br><br>No changes are detected when a connection is activated or deactivated.<br><br>If this check box is selected, the map is automatically<br>synchronized when opened from the component after a change. If not, a dialog appears to<br>ask whether you want to synchronize.<br><br>Information noteNote: For structures with multiple<br>connections, the map can only be synchronized if the structures have the same form<br>as the ones generated by the component configuration wizard. For example, flattening<br>maps with multiple outputs cannot be synchronized automatically. |
| Map Path | Specifies the map to be executed.<br><br>If the map was automatically created using the wizard described above,<br>this is path is set automatically.<br><br>If you want to use an existing map, click the [...] button next to the Map<br>Path field to open a dialog box in which you can select<br>the map you want to use, then click the [...] button next to Open Map<br>Editor to work with the map selected. Note that this map<br>must have previously been created in the<br>Mapping<br>perspective. |
| Read Input As | Select the radio button which corresponds to how you want the input to<br>be read. Depending on your map, only some of the options may be<br>available.<br><br><ul> <li> <p> <span>Data Integration columns</span>                                    (default): Use this option if you are working with <span>Talend Data Integration</span>  metadata.</p> </li> <li> <p> <span>Single column</span>: Use this option                                    if you are working with <span>Talend Data Mapper</span>  metadata.</p> </li> </ul> |
| Write Output As | Select the radio button which corresponds to how you want<br>the output to be written. Depending on your map, only some of the<br>options may be available.<br><br><ul> <li> <p> <span>Data Integration columns</span>                                    (default): Use this option if you are working with <span>Talend Data Integration</span> metadata.</p> </li> <li> <p> <span>String (single                                        column)</span>: Use this option if the data in the                                    output column is to be a <span>String</span>.</p> </li> <li> <p> <span>Byte array (single                                        column)</span>: Use this option if the data in the                                    output column is to be a <span>Byte                                        array</span>.</p> </li> <li> <p> <span>InputStream (single                                        column)</span>: Use this option if you are working with                                        <span>Talend Data Mapper</span> metadata and the input data is a                                    stream.</p> </li> <li> <p> <span>Document (single column)</span>;                                    Use this option if the output column is to be a <span>Document</span>.</p> </li> </ul> |

## Advanced settings

| Properties | Description |
| --- | --- |
| Map Variable | In this field, enter a context variable or a global variable<br>that contains a path to a map. For instance, if you enter *context.mymapfile*, then *mymapfile* can point to<br>different map files at runtime. This can be useful in cases where you want to<br>use multiple maps without creating a new Job each time.<br><br>The value of the variable must be a relative path. For<br>instance, assuming you have a map called *mapA* in the<br>folder *Maps/FolderA*, your variable should contain the<br>value *"FolderA/mapA.xml"*. You can write the path to the<br>file with or without the .xml extension.<br><br>Note that all maps that might be referenced by the variable<br>must be present in the same project. This way, when the Job is built, it will<br>contain all candidate maps and it will be possible to switch from one to<br>another at runtime.<br><br>For further information on working with context variables, see<br>[Using contexts and variables](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/contexts-and-variables) in the<br>Talend Studio User Guide. |
| Alternate contextual Map(s) | From the drop-down list, select a map or several maps that can be referenced by<br>the context variable added in the Map Variable at<br>runtime.<br><br>The alternate maps selected must have the same map type (standard or DSQL) as<br>the original map.<br><br>When the Job is built, it contains the selected alternate contextual map or<br>maps. For an example scenario on using Alternate contextual Map(s), see [Specifying a map variable and alternate map in tHMap](https://help.qlik.com/talend/en-US/components/8.0/data-mapping/specifying-map-variable-and-alternate-map-in-thmap) |
| Map each row (disable virtual<br>component) | Select this check box to have tHMap process the input as a single output row. This<br>prevents tHMap from buffering the<br>input rows before delivering them downstream.<br><br>This can be useful, for example, when you use the<br>tHMap component with<br>tSAPIDocReceiver as the input<br>component and any schema-aware component as the output component,<br>because telling the tSAPIDocReceiver component to keep listening forever<br>would otherwise lead to rows never being delivered.<br><br>If the tHMap is used with an input component that<br>can remain open to continuously receive inputs, such as the<br>tRestRequest, this option should be selected.<br>It allows the tHMap to directly process the input<br>received. |
| Emit empty payload | Select this check box to send an empty row in the<br>output connection when there is no output data. This can happen if there is<br>no input or if the entire input is filtered out in the map. If this check<br>box is cleared, no rows are sent to the output connection.<br><br>This option is applied only when the Map each row check box is<br>cleared. |
| Use old Eclipse runtime (deprecated) | Select this check box to include the old Eclipse runtime in<br>your Job.<br><br>Information noteNote: This option is available only if you have<br>installed the R2024-03 Talend Studio<br>monthly update or a later one delivered by Talend.<br>For more information, check with your administrator.<br><br>Information noteNote: From Talend Studio 8.0 R2025-04<br>onwards, the Use old Eclipse runtime (deprecated) parameter<br>has been removed. |
| Exception Threshold | Talend Data Mapper returns an execution status with an severity<br>value which can be OK, Info, Warning, Error or Fatal. By setting the exception threshold, you can<br>specify the severity level at which an exception is thrown, thus<br>enabling downstream components to detect the error in cases other than<br>the default value of Fatal.<br><br>From the drop-down list, select the severity level at<br>which an exception may be thrown during the execution of a map.<br><br><ul> <li> <p> <span>Fatal</span> (default): An                                    exception is thrown when a fatal error occurs. </p> </li> <li> <p> <span>Error</span>: An exception is                                    thrown when an error (or higher) occurs.</p> </li> <li> <p> <span>Warning</span>: An exception is                                    thrown when a warning (or higher) occurs. </p> </li> </ul><br><br>To help you diagnose problems with your map, when you test the<br>map in Talend Studio, any errors that occur which are at warning level or above will be printed<br>in the console window, regardless of the setting of the Exception Threshold. |
| tStatCatcher Statistics | Select this check box to gather the Job processing<br>metadata at the Job level as well as at each component level. |

## Global Variables

| Variables | Description |
| --- | --- |
| Global Variables | ERROR\_MESSAGE: the error message generated by the<br>component when an error occurs. This is an After variable and it returns a string. This<br>variable functions only if the Die on error checkbox is<br>cleared, if the component has this checkbox.<br><br><br>MapExecutionStatus: returns an object of the<br>org.talend.transform.runtime.common.MapExecutionStatus<br>class<br><br><br>EXECUTION\_SEVERITY: the *Overall<br>Severity* numeric value. This is an After variable and it returns an<br>integer.<br><br>A Flow variable functions during the execution of a component<br>while an After variable functions after the execution of the component.<br><br>To fill up a field or expression with a variable, press Ctrl+Space to access the variable list and choose the variable to use from<br>it.<br><br>For more information about variables, see [Using contexts and variables](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/contexts-and-variables). |

## Usage

| Usage guidance | Description |
| --- | --- |
| Usage rule | tHMap is used for Jobs that<br>require complex data mapping from a variety of different sources.<br><br>The input and output connections can use<br>Talend Data Mapper metadata, Talend Data Integration<br>metadata, or a combination of the two. Each connection is<br>independent.<br><br>When you open the Map Editor for the<br>first time for each connection, it either generates a Talend Data Mapper<br>structure definition based on the schema of the Talend Data Integration<br>component, or allows you to select an existing Talend Data Mapper<br>structure if you are using Talend Data Mapper metadata. It then creates a map<br>with the structure selected or generated.<br><br>This component can be used in several ways:<br><br><ul> <li> <p>You can work with a <span>Talend Data Mapper</span>  map and structures based on <span>Talend Data Mapper</span>  metadata. In this case, the                                        components (for instance, <span>tFileInputRaw</span> and                                            <span>tFileOutputRaw</span>) pass the data in a single                                        column in a single row.</p> <p>For an example of this usage, see <a href="https://help.qlik.com/talend/en-US/components/8.0/data-mapping/thmap-tfileinputraw-tfileoutputraw-tfileoutputraw-using-talend-data-mapper-metadata-standard-component-enterprise-the" target="_blank">Using  metadata</a>.</p> </li> <li> <p>You can work with <span>Talend Data Integration</span>  metadata. In this case, you connect                                        an input and output component to <span>tHMap</span> then open the Map                                        Editor without specifying a map path.</p> <p>For an example of this usage, see <a href="https://help.qlik.com/talend/en-US/components/8.0/data-mapping/thmap-tfileinputdelimited-tfileoutputxml-tfileoutputxml-using-talend-data-integration-metadata-standard-component-enterprise-the" target="_blank">Using  metadata</a>.</p> </li> <li> <p>You can work with a                                        combination of <span>Talend Data Mapper</span>  metadata and                                            <span>Talend Data Integration</span>  metadata.</p> <p>For an example of this usage, see <a href="https://help.qlik.com/talend/en-US/components/8.0/data-mapping/thmap-trowgenerator-tfileoutputraw-tfileoutputraw-transforming-from-data-integration-schema-to-complex-content-schema-standard-component-enterprise-the" target="_blank">Transforming from a Data Integration schema to a complex content			schema</a>.</p> </li> <li>You can work with raw file inputs and schema-based input connections as                                    inputs to <span>tHMap</span>. <p>For examples of this                                        usage, see <a href="https://help.qlik.com/talend/en-US/components/8.0/data-mapping/thmap-trowgenerator-generating-output-using-thmap-with-multiple-schema-inputs-spark-batch-component" target="_blank">Generating the Output Using tHMap with Multiple Schema Inputs</a> and <a href="https://help.qlik.com/talend/en-US/components/8.0/data-mapping/thmap-tfileinputraw-generating-output-using-thmap-with-multiple-payload-inputs-spark-batch-component" target="_blank">Generating the Output using tHMap with Multiple Payload Inputs</a>.</p> </li> <li>You can work with database tables created in <span>Talend Studio</span> and connect these tables as inputs to <span>tHMap</span>. If you                           have Jobs that use the deprecated DatabaseLookup feature, see <a href="https://help.qlik.com/talend/en-US/components/8.0/data-mapping/migrating-from-databaselookup-to-thmap" target="_blank">Migrating from DatabaseLookup to tHMap</a> for the steps                           on how to migrate to tHMap.</li> <li>You have the option to connect tHMap to multiple database output                                    connections. To migrate previously created Jobs using IO                                    Database functions, see <a href="https://help.qlik.com/talend/en-US/components/8.0/data-mapping/migrating-io-database-functions-to-thmap-multi-output-database-connections" target="_blank">Migrating IO Database functions to tHMap Multi-Output Database Connections</a>.</li> <li>You can connect <span>tHMap</span> to multiple output                                    connections using raw file, schema-based connections, and                                    payload-based connections.</li> <li> <p> <a href="https://help.qlik.com/talend/en-US/components/8.0/data-mapping/thmap-tjava-tfixedflowinput-tjavarow-handling-errors-standard-component-enterprise-this" target="_blank">Handling errors</a> shows how to handle error conditions using the <span>tHMap</span> component.</p> </li> <li> <p>For a thMap with a single connection, the Wrap Structure                                        option (Allow tHMap to support multiple inputs/outputs) is,                                        by default, unchecked for these options: <span>Generate                                            from Schema</span> (schema-based) and                                            <span>Select From Existing Structure</span>                                        (payload-type).</p> </li> </ul> |
| Advanced use case | <ul> <li>For the output Structure of the <span>thMap</span>, you can also use the                                    <span>WriteURL</span> function in                                    <span>Talend Data Mapper</span> .                                In case the output Structure of the <span>tHMap</span> includes both a connection to a <span>Talend Data Integration</span>  metadata or                                component and a <span>WriteURL</span>                                function, the <span>WriteURL</span> value                                takes precedence. <span>Talend Data Integration</span> metadata or component does not receive any                                data from <span>tHMap</span>. </li> <li> <p>Using <span>tHMap</span>, you can test the generated                                        <span>Talend Data Mapper</span>                                    Map in <span>Test Run</span> mode. </p> <div>To use the feature, ensure that you have a compatible input                                    document of CSV format with these properties:<ul> <li>The default delimiter is the (,) comma.</li> <li>The system default line separator is used as the newline.</li> <li>There is no header row in the input file.</li> <li>There will be no header row in the output file.</li> </ul> </div> <p>Specify your input document in <span><span>Show Document</span><abbr> &gt; </abbr><span>Select Sample Input Document</span><abbr> &gt; </abbr><span>Select Resource/Import Document</span></span>.</p> <p>To execute the transformation, click <span>Test Run</span>.                           After execution, your generated output document is in CSV format, which                           you can save by clicking <span>Save to File</span>. To                           configure this feature, see <a href="https://help.qlik.com/talend/r/en-US/8.0/data-mapper-user-guide/test-preferences" target="_blank">Test preferences</a>.</p> <div><span>Information note</span><span>Tip:</span> If you have multiple inputs and outputs in your                                    Map, specify an input document for each row or each ReadURL map                                    element. To execute, use the <span>Test Run to External                                        Output</span> option and specify a file URL for each                                    WriteURL in the output structure of the Map.</div> </li> </ul> |
| Limitations | <ul> <li>If you created a tHMap with multiple input or output connections,                                you can only add new schema-based input or output connections. </li> <li>When you add a new connection with a single column, you cannot                                associate it with a payload structure. The Map Regeneration                                mechanism only generates a single-element record for the new                                connection.</li> <li>A Job containing a tHMap cannot be deployed as an OSGi bundle with                                the old Eclipse-based runtime.</li> </ul> |
| Usage with Talend Runtime | If you want to deploy a Job or Route containing a data mapping component<br>with Talend Runtime, you first need to install the Talend Data Mapper feature. For more information, see [Using Talend Data Mapper with Talend Runtime](https://help.qlik.com/talend/r/en-US/8.0/data-mapper-user-guide/using-talend-data-mapper-with-talend-runtime). |

Information noteNote:

* For further information about performing transformations using Talend Data Mapper , see [this documentation](https://help.qlik.com/talend/r/en-US/8.0/data-mapper-user-guide/what-is-talend-data-mapper).

* When using representations other than Map, CSV, Avro, XML, and Cobol, running this component with the old Eclipse-based Runtime may create temporary folders, which are not automatically removed after stopping the Runtime. If you frequently run Talend Data Mapper, these files may pile up and eventually lead to a disk full error. When the error occurs, the runtime fails. To avoid this, ensure that you perform periodical cleaning. For more information, see [Cleaning up temporary folders and files](https://help.qlik.com/talend/r/en-US/8.0/data-mapper-user-guide/cleaning-up-temporary-folders-and-files).

**Related concepts**

* [Generating the Output using tHMap with Multiple Payload Inputs](https://help.qlik.com/talend/en-US/components/8.0/data-mapping/thmap-tfileinputraw-generating-output-using-thmap-with-multiple-payload-inputs-spark-batch-component "tHMap allows you to connect multiple payload inputs and generates the output in a single result. In this scenario, you will learn how to create a Job with a tHMap connected to a multiple inputs.")
* [Generating the Output Using tHMap with Multiple Schema Inputs](https://help.qlik.com/talend/en-US/components/8.0/data-mapping/thmap-trowgenerator-generating-output-using-thmap-with-multiple-schema-inputs-spark-batch-component "tHMap supports multiple inputs coming from either schema-based input connections or other raw file inputs. In this scenario, you can see how you can generate outputs using schema-based inputs with Main connections to the tHMap component.")
* [Handling errors](https://help.qlik.com/talend/en-US/components/8.0/data-mapping/thmap-tjava-tfixedflowinput-tjavarow-handling-errors-standard-component-enterprise-this)
* [Transforming from a Data Integration schema to a complex content schema](https://help.qlik.com/talend/en-US/components/8.0/data-mapping/thmap-trowgenerator-tfileoutputraw-tfileoutputraw-transforming-from-data-integration-schema-to-complex-content-schema-standard-component-enterprise-the)
* [Using Talend Data Integration metadata](https://help.qlik.com/talend/en-US/components/8.0/data-mapping/thmap-tfileinputdelimited-tfileoutputxml-tfileoutputxml-using-talend-data-integration-metadata-standard-component-enterprise-the)
* [Using Talend Data Mapper metadata](https://help.qlik.com/talend/en-US/components/8.0/data-mapping/thmap-tfileinputraw-tfileoutputraw-tfileoutputraw-using-talend-data-mapper-metadata-standard-component-enterprise-the)