Modulus partitioned read method
When this method is selected, for each node, the connector reads the rows that satisfy the following condition: ABS(MOD(column_name, number_of_nodes)) = node_number. In this condition, ABS returns the absolute value of the argument, MOD is the modulus function, column_name is the name of the column that is specified in the
property, number_of_nodes is the total number of nodes on which the stage runs, and node_number is the index of the current node.The indexes are zero-based. Therefore, the first node has index 0, the second node has index 1, and so on.
To use this method, you must specify a column name from the source table in the MOD and ABS functions description in the IBM Db2 Knowledge Center.The specified column must exist in the table that is specified in the property or the Select statement property. The value for the Select statement property is used only if the Generate SQL property is set to No.
property. The column that you specify must be a numeric data type that is supported by the MOD() function of Db2. For more information, refer toExample of using the modulus partitioned read method
- The Generate SQL property is set to No.
- The Select statement property is set to .
- The connector is configured to run in parallel mode on four nodes.
- The Partitioned reads method property is set to Modulus
- The Column name property is set to COL2, and COL2 is defined as INTEGER in TABLE1.
SELECT * FROM TABLE1 WHERE ABS(MOD(COL2, 4)) = 0 AND (COL1 > 10)
SELECT * FROM TABLE1 WHERE ABS(MOD(COL2, 4)) = 1 AND (COL1 > 10)
SELECT * FROM TABLE1 WHERE ABS(MOD(COL2, 4)) = 2 AND (COL1 > 10)
SELECT * FROM TABLE1 WHERE ABS(MOD(COL2, 4)) = 3 AND (COL1 > 10)