Counter value in Grid Partition

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
dj
Participant
Posts: 78
Joined: Thu Aug 24, 2006 5:03 am
Location: india

Counter value in Grid Partition

Post by dj »

Hi All,

Iam Currently using Datastage 8.5 Version. I have created a counter stage variable in transformer (whichis set in sequential mode)

My requirment is I need to Process the records when the counter <=50
Only the 50 records for each Accounttype.

Counter: If CurrentAccounttype=PrevAcctype then counter+1 else 1.

I have checked the counter values, it is generated correctly for each accttype.

But the output link from transformer does not consider for the constraint.

even when i tried a filter stage it didnt work.

the grid details are computenodes(2,2) and partition 1. since it runs in 2nodes, not all the records <=50 goes down to the next links.

thanks in advance !

-dj
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Never seen a situation where a constraint was 'ignored'. Show us your actual constraint expression. Also, have you included the counter on the output link or are you just counting?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The fact that it's on a grid is immaterial. Counters are computed per node. Constraint expressions are evaluated per node. So, with four nodes, counter <= 50 should generate approximately 200 rows.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It's actually up to 50 records per account type, so no way to know how many output rows we're talking about here. And yes, the 'grid' aspect plays no role here.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

You said the transformer performing the counting is running in sequential mode. That means it is active in only one logical node. Is the constraint in that transformer, or in a later transformer which runs in parallel mode (and hence in 2 logical nodes)? Seeing the constraint logic would be a helpful step.

What is the data type for your counter?

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
dj
Participant
Posts: 78
Joined: Thu Aug 24, 2006 5:03 am
Location: india

Post by dj »

The output from the transformer for each account type should restrict for 50rows.

Input to transformer is SOrted on Accttype

stagevar details:

Currval: AcctType
Counter : If CurrVal=PreVal then Counter+1 Else 1
PreVal:Currval

Constraint: Counter<=50

Output From Transfomer;

peekstage:

AcctType Counter
A1 1
A1 2
A1 26
A1 50
B1 3
B1 50

The issue is the for each accttype not all 50rows are outputed from transformer.

How does the transformer process the rows ,does it runs in 2 nodes and skips the other valid rows from node 1 when node 2 counter reaches=50


Thanks,
dj
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

How are you partitioning? Does the job work as expected when you run it on one node? If so, your partitioning is incorrect.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I'd also be curious what settings you are using in the Peek stage. By default it does not capture all rows...
-craig

"You can never have too many knives" -- Logan Nine Fingers
dj
Participant
Posts: 78
Joined: Thu Aug 24, 2006 5:03 am
Location: india

Post by dj »

In the transformer i have set it as sequential for generating the counter.

In Peek , it is set by Default (Parallel).

when there are 60rows for accttype ,the peekstage doesn't capture all the 50rows.

AcctType Counter
A1 1
A1 2
A1 26
A1 50

B1 3
B1 50

The input is Hash partitioned and sort on AcctType.
**when i tried mentioning explicitly counter=1 or counter=2 or counter=3 in the constrinat, i was able to get the row3.

Please advice where the gap is..

Thanks,
dj
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Unless you change the default settings, the Peek stage will capture 10 rows per node.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply