Partitioning Examples
The following examples show how you can configure partitioning in a mapping.
Partitioning with a Flat File Source
You have a Mapping Configuration task that uses a large, 1GB flat file source. You want to specify two partitions in the Source transformation to optimize performance.
On the Partitioning tab for the Source transformation, you enter the number of partitions, as shown in the following diagram:
Key Range Partitioning with a Relational Database Source
You have customer names, addresses, and purchasing history in a relational database source. You decide to partition the source data into three partitions based on postal codes, using the following ranges:
- •First partition: Minimum value to 30000
- •Second partition: 30001 to 50000
- •Third partition: 50001 to maximum value
On the Partitioning tab for the Source transformation, you select the BILLINGPOSTALCODE field for the key range. You add three key ranges to create three partitions, as shown in the following diagram:
Note that for the first partition, you leave the start value blank for the minimum value. In the last partition, you leave the end value blank for the maximum value.
Using these values, records with a postal code of 0 up to 30000 are processed in partition #1, records with a postal code of 30001 to 50000 are processed in partition #2, and records with a postal code of 50001 or higher are processed in partition #3.
After you configure the mapping, you save and run the mapping to validate the partitions.