Modulus Partitioning - DataStage

Veröffentlicht am: 16 Dezember 2018
auf dem Kanal: 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.


Auf dieser Seite können Sie das Online-Video Modulus Partitioning - DataStage mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Datastage Tutorial 16 Dezember 2018 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,799 Mal angesehen und es wurde von 18 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!