Hash partition with difference in numeric key columns

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
le thuong
Premium Member
Premium Member
Posts: 76
Joined: Wed Sep 09, 2009 5:21 am

Hash partition with difference in numeric key columns

Post by le thuong »

I encounter the following issue on a join stage on 5 columns (3 varchar, 2 numeric). The 2 inputs are sorted and hash partitioned on the 5 columns. For a given combination of the 5 key columns, we were expecting a match between the 2 inputs, and Datastage job did not return a match.

I found out that the issue is due to the fact that the numeric data types in the left input were not equal to the numeric data types of the right input (Dec 10,4 vs Dec 38,10 if I am correct), even if the numeric values were equal.

The solution was to convert the numeric data types to get the same on the 2 inputs.

Did someone meet the same issue ?

This means that applying Hash partition to a number can give a different value depending on the data type and not only on the value of the number ?
Thuong

best regards
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

You correctly found the issue, Yes the hash calculation takes the data type in to account as well, hence the issue. Even if the extended property of a varchar (unicode) is set it will have different hash than that of a varchar.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That said, it is working as documented.
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