# tPartitioner

Partitions the input data before tCollector can transfer them to the parallel execution processes.

The tPartitioner splits the input records into a given number of threads which tCollector sends for parallel execution.

Note that Talend Studio also enables the automatic implementation of parallelization across a Job without use of the parallelization components and Talend recommends using that approach. For further information, see [Enable parallelization of data flows](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/enabling-parallelization-of-data-flows). However, if you need to understand how to use these specific parallelization components, bear in mind that the parallelization components work closely with each other to accomplish parallel execution on given processes: the tPartitioner component dispatches the input records into a specific number of threads; the tCollector component sends these threads to its following components for parallel execution; the tDepartitioner component regroups the outputs of the processed parallel threads; the tRecollector component captures the output of a given tDepartitioner component and sends the captured data to the next component.

This component is not shipped with your Talend Studio by default. You need to install it 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).

## tPartitioner Standard properties

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

The Standard tPartitioner component belongs to the Orchestration family.

This component is available in Talend products with Big Data, Talend Data Management Platform, Talend Data Services Platform, and Talend Data Fabric.

## Basic settings

| Properties | Description |
| --- | --- |
| Schema and Edit<br>Schema | A schema is a row description, it defines the number of fields to be processed and<br>passed on to the next component. The schema is either Built-in or stored remotely in the<br>Repository.<br><br>Click Edit<br>schema to make changes to the schema. If the current schema is of the Repository type, three options are available:<br><br><ul> <li> <p> <span>View schema</span>: choose this                option to view the schema only.</p> </li> <li> <p> <span>Change to built-in property</span>:                choose this option to change the schema to <span>Built-in</span> for local changes.</p> </li> <li> <p> <span>Update repository connection</span>:                choose this option to change the schema stored in the repository and decide whether                to propagate the changes to all the Jobs upon completion.</p> <p>If you just want to                propagate the changes to the current Job, you can select <span>No</span> upon completion and choose this schema metadata                again in the <span>Repository Content</span>                window.</p> </li> </ul><br><br>Click Sync<br>columns to retrieve the schema from the previous component connected in the<br>Job. |
| Number of Child Threads | Enter the number of threads you want to split the input records up<br>into.<br><br>We recommend that this number be N-1 where N is the total number<br>of CPUs or cores on the machine processing the data. |
| Buffer Size | Enter the number of rows to be processed before the memory is freed.<br><br>This is the number of rows to cache for each of the threads<br>generated. |
| Use a key hash for partitions | Select this check box to use the hash mode to dispatch the input<br>records into threads.<br><br>Once selecting it, the Key<br>Columns table appears, in which you set the column(s)<br>you want to apply the hash mode on. In the hash mode, the records<br>meeting the same criteria are dispatched into the same threads.<br><br>If you leave this check box clear, the dispatch mode is<br>Round-robin, meaning records are dispatched one-by-one to each<br>thread, in a circular fashion, until the last record is dispatched.<br>Be aware that this mode cannot guarantee that records meeting the<br>same criteria go into the same threads. |

## Advanced settings

| Properties | Description |
| --- | --- |
| tStatCatcher Statistics | Select this check box to collect the log data at the component<br>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>NB\_LINE:<br>the number of rows processed. This is an After variable and it returns an 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** | This component should be put after the input component(s) and<br>before tCollector.<br><br>This component uses and can only use the Trigger &gt; Start link to connect to tCollector. |
| Connections | Outgoing links (from this component to another):<br><br><br>Trigger: Start.<br><br>Incoming links (from one component to this one):<br><br><br>Row: Main.<br><br>For further information regarding connections, see [Using connections in a Job](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/using-connections-in-job). |

**Related concepts**

* [Sorting the customer data of large size in parallel](https://help.qlik.com/talend/en-US/components/8.0/orchestration/tdepartitioner-tpartitioner-trowgenerator-sorting-customer-data-of-large-size-in-parallel-standard-component-platform-the-job)