Switch

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
legendkiller
Participant
Posts: 60
Joined: Sun Nov 21, 2004 2:24 am

Switch

Post by legendkiller »

in switch stage I have selected selectore mode as hash the documentation says following

"Hash means that rows are hashed on the selector column modulo the number of output links and assigned to an output link accordingly"

I am not getting what it does

my job has 3 output link and selectore column has values 2,3,10, 1
then in Out put I should get

2mod3 - assign to output dataste with label 2
3mod3 - assign to output dataste with label 0
10mod3 - assign to output dataste with label 1
1mod3 -assign to output dataste with label 1

is my understanding is correct
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

LegendKiller,

you are correct, the modulo goes from link number 0 to {n-1}.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Where DO the rows go, given that you seem to be implying that they don't go where you expect them to?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
legendkiller
Participant
Posts: 60
Joined: Sun Nov 21, 2004 2:24 am

Post by legendkiller »

ray.wurlod wrote:Where DO the rows go, given that you seem to be implying that they don't go where you expect them to?

yes in my case

when selector value are 2,1 then they are going to dataset label 2

when selector value are 3,10 then they are going to dataset label 1

so it is not behaving as I expected

the input selector value are 2,3,10,1 and outpit link are 3 so i expected that

row containing value 2 will go to dataset 2
row containing value 3 will go to dataset 0
row containing value 1,10 will go to dataset 1

do i need to put partition as hash
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Your expectations are based on a modulus algorithm, so why not use that? You can not assert that a hashing algorithm will produce the same results as a modulus algorithm - hashing algorithms incorporate extra processing to try to guarantee repeatably-random but even allocation.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
adarsh shrinagesh
Premium Member
Premium Member
Posts: 68
Joined: Sat Feb 05, 2005 4:59 am
Location: India

Post by adarsh shrinagesh »

legendkiller wrote:
ray.wurlod wrote:Where DO the rows go, given that you seem to be implying that they don't go where you expect them to?

yes in my case

when selector value are 2,1 then they are going to dataset label 2

when selector value are 3,10 then they are going to dataset label 1

so it is not behaving as I expected

the input selector value are 2,3,10,1 and outpit link are 3 so i expected that

row containing value 2 will go to dataset 2
row containing value 3 will go to dataset 0
row containing value 1,10 will go to dataset 1

do i need to put partition as hash
Hi

Have u been able to sort the anomaly
Have been trying to simulate the same scenario and am hitting the same prblm even after using modulo as the partitioning algo.

Thnx
Post Reply