Partitioner Stage outputs zeros

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ian_bennett
Participant
Posts: 15
Joined: Sun Sep 01, 2002 6:56 pm
Location: Australia
Contact:

Partitioner Stage outputs zeros

Post by ian_bennett »

When using the partitioner stage with either Modulus or Hash option it outputs "0" for every column. Works fine for Round Robin.

I am using a single Decimal column for the hash key and was going to use Modulus to ensure that records with the same value are sent down the same output link.

Am I missing something obvious here?
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
Sounds like a bug here.
There is no way for me to get 6 version to test so I'd say contact your support.
Good Luck,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
rleishman
Premium Member
Premium Member
Posts: 252
Joined: Mon Sep 19, 2005 10:28 pm
Location: Melbourne, Australia
Contact:

Post by rleishman »

Make sure that the key columns in all of the Output links of the Link Partitioner match those of the Input columns. Do the same for the Link Collector.

This has caused me grief in the past by producing unpredictable results.

Tell us if it works.
Ross Leishman
ian_bennett
Participant
Posts: 15
Joined: Sun Sep 01, 2002 6:56 pm
Location: Australia
Contact:

Post by ian_bennett »

Yep, all the columns match. Works fine for Round-Robin so shouldnt be anything like that.

I dont use a link collector. The partitioner is to allow me to do a parallel sort and then each stream will insert to database independently.
rleishman wrote:Make sure that the key columns in all of the Output links of the Link Partitioner match those of the Input columns. Do the same for the Link Collector.

This has caused me grief in the past by producing unpredictable results.

Tell us if it works.
rleishman
Premium Member
Premium Member
Posts: 252
Joined: Mon Sep 19, 2005 10:28 pm
Location: Melbourne, Australia
Contact:

Post by rleishman »

Just to make sure, you did check the KEY attribute on each output link matched the input link, didn't you (sorry - just me being pedantic). Just to be doubly sure, use right-click / propogate columns / {input link} / All links (if avail. in your version).

Also, make sure that the Derivation is populated in the output links (if it works for Round-Robin, then I'm sure it is OK)

The help file says that the Modulus function requires an Integer data type column. Try casting your decimal to Integer with a Transformer in a prior stage. Doesn't explain why Hash is not working though.

If you have no joy, you could always just do it with a Transformer and a different constraint on each output link. :?
Ross Leishman
ian_bennett
Participant
Posts: 15
Joined: Sun Sep 01, 2002 6:56 pm
Location: Australia
Contact:

Post by ian_bennett »

Thanks

Propogating did the trick!

Not sure what the problem was though since I had originally defined the columns by using a Transformer stage to copy columns and then moving the link to the Partitioner stage (old habits die hard).

rleishman wrote:Just to make sure, you did check the KEY attribute on each output link matched the input link, didn't you (sorry - just me being pedantic). Just to be doubly sure, use right-click / propogate columns / {input link} / All links (if avail. in your version).

Also, make sure that the Derivation is populated in the output links (if it works for Round-Robin, then I'm sure it is OK)

The help file says that the Modulus function requires an Integer data type column. Try casting your decimal to Integer with a Transformer in a prior stage. Doesn't explain why Hash is not working though.

If you have no joy, you could always just do it with a Transformer and a different constraint on each output link. :?
ShaneMuir
Premium Member
Premium Member
Posts: 508
Joined: Tue Jun 15, 2004 5:00 am
Location: London

Post by ShaneMuir »

Just an update to this problem, for everyones info. I don't think it was caused by the propogating of the columns or lack thereof.

I was having the same issue in ver6, where I was using the sequence

Code: Select all

                                  /----> Seq1
                                 /
OraOCI8 ---> Trf ---> Partition <
                                 \
                                  \----> Seq2
No matter which partition algorithm I used the result was always the same: all columns in the output field would be populated with 0's. The record counts would be right (ie the partition actually worked and sent the correct number of rows down each stream) but all the values would be 0.

Anyway I found that if I added a seq file between the Trf and the partition that it would work as expected. Further digging revealed that if I activate Inter-process row buffering on the performance tab in the job properties that it would work without the intermediate sequential file.

Just thought I would share that with everyone.
Shane
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

You bet. Thanks for Sharing!

Whale.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The documentation for Link Partitioner specifically notes that inter-process row buffering must be enabled when this stage type is used, because it creates a process for itself. See top of page 13-2 in Server Job Developer's Guide for version 7.5
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