Hi!
I have strange problem. I have got transformer and output of transformer is connected with two different hash files.
As input of transformer I veve got sequence of surrogate keys( made with GetKeyNextValue) colA, colB and colC. I'm putting key column, colA as PK, colB as PK into firs hash - key column, colB as PK and colC as PK into second one.
When job is finished, in my log I have 2000 rows written to hash1 and 2000 rows written to hash2.
But I have noticed that some integer keys which are in first hash aren't in second.
I used UniVerse stage and made SQL to hash files - and there is 2000 rows in first hash and 1900 in second!
Do you have any ideas why it is happens??
Writing data into two hash
Moderators: chulett, rschirm, roy
Luk,
as you stated, both links had 2000 rows go down them. Since the way that Hash files work is that WRITEs to an already existing key will perform an overwrite of the existing record, you need to look at your PK on the second file of ColB and ColC.
I would suggest you change the stage to drop & re-create the hash file and make sure you are using both ColB and ColC as keys in the output to that stage. You have some periodicity to the overwrites, so if you do a select of your second file and order by ColB and ColC you should, within the first couple of pages, find a "missing" row which might help debug the problem. Which integer keys are missing? Could you have leading "0"s?
as you stated, both links had 2000 rows go down them. Since the way that Hash files work is that WRITEs to an already existing key will perform an overwrite of the existing record, you need to look at your PK on the second file of ColB and ColC.
I would suggest you change the stage to drop & re-create the hash file and make sure you are using both ColB and ColC as keys in the output to that stage. You have some periodicity to the overwrites, so if you do a select of your second file and order by ColB and ColC you should, within the first couple of pages, find a "missing" row which might help debug the problem. Which integer keys are missing? Could you have leading "0"s?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Luk,
if you ran the job and created the hash file with just one column as the PK and later added the second column the file will only use the original definition, that's why I suggested you force delete and re-create the file. This is a relatively common source of problems. Does it now work?
if you ran the job and created the hash file with just one column as the PK and later added the second column the file will only use the original definition, that's why I suggested you force delete and re-create the file. This is a relatively common source of problems. Does it now work?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Yes that is true - I have noticed that pair of PK columns is not 100% unique !!!
I am using checbox "create file" and checkbox "delete file befor creation" in hash options. Is it enaugh for recreating file with new definition??if you ran the job and created the hash file with just one column as the PK and later added the second column the file will only use the original definition,
LUK
Luk,
in order for this forum to work it would be nice to have you tell us what the solution and/or the problem was so that others might search this thread and get a solution.
in order for this forum to work it would be nice to have you tell us what the solution and/or the problem was so that others might search this thread and get a solution.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>