The following examples show how you can configure partitioning in a mapping.
Partitioning with a Flat File Source
You have a
task that uses a large, 1GB flat file source. You want to specify two partitions in the Source transformation to optimize performance.
tab for the Source transformation, you select fixed partitioning and enter the number of partitions, as shown in the following image:
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
tab for the Source transformation, you select key range partitioning and choose the BILLINGPOSTALCODE field as the partition key. You add three key ranges to create three partitions, as shown in the following image:
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.