Modulus Partitioning - DataStage

Publicado el: 16 diciembre 2018
en el canal de: 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.


En esta página del sitio puede ver el video en línea Modulus Partitioning - DataStage de Duración hora minuto segunda en buena calidad , que subió el usuario Datastage Tutorial 16 diciembre 2018, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 1,799 veces y le gustó 18 a los espectadores. Disfruta viendo!