Modulus Partitioning - DataStage

Publié le: 16 décembre 2018
sur la chaîne: Datastage Tutorial
1,799
18

Modulus partitioning is also key based partitioning like hash partitioning. But, in modulus partitioning, only one integer column can be defined as key field since modulus operation cannot be performed on non-integer values.

The partition number of each record is calculated as follows:

partition_number = integer_field mod number_of_partitions

In the diagram the age field has been selected as the key field for mod operation. The Input data has the following distinct age values: 22,23,32,34. And there are 3 processing nodes among which the input data has to be partitioned and distributed. So, we divide the age value of each record by 3 and get the remainder as the value. The result of mod operation on the age values are as follows:

Mod(22,3) = 22%3 = 1

Mod(23,3) = 23%3 = 2

Mod(32,3) = 32%3 = 2

Mod(34,3) = 34%3 = 1



The records with mod key result as 1 are sent to partition 1 (node 2 processor). The records with mod key result as 2 are sent to partition 2 (node 3 partition). There are no records with mod key result as 0. Hence, no records are sent to partition 0 (node 1 processor). It’s clearly understood, that like hash partitioning, Modulus partitioning, also, creates uneven partitioning which can cause certain processing nodes to work more than the other nodes available in the system.


Sur cette page du site, vous pouvez voir la vidéo en ligne Modulus Partitioning - DataStage durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Datastage Tutorial 16 décembre 2018, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 1,799 fois et il a aimé 18 téléspectateurs. Bon visionnage!