CRC32

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
ranga1970
Participant
Posts: 141
Joined: Thu Nov 04, 2004 3:29 pm
Location: Hyderabad

CRC32

Post by ranga1970 »

I was told CRC#@ has some limitations, But I used it and I could myself feel any of these limitations, Could some one please tell me, what kind of limitations are there and any problems faced by them
RRCHINTALA
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What did you feel that the limitations were? You claim to have been able to feel them?

There is, with any such model, a very tiny probability that two different values will generate the same result using algorithms like CRC32. The probability is low enough for us to feel comfortable even processing thousands of millions of 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.
ranga1970
Participant
Posts: 141
Joined: Thu Nov 04, 2004 3:29 pm
Location: Hyderabad

Post by ranga1970 »

I said

Code: Select all

 was told CRC#@ has some limitations, But I used it and I could myself feel any of these limitations, Could some one please tell me, what kind of limitations are there and any problems faced by them
But actually I meant

Code: Select all

 was told CRC#@ has some limitations, But I used it and I could myself [b] did not [/b] feel any of these limitations, Could some one please tell me, what kind of limitations are there and any problems faced by them
It was typo I miised did not and it changed the meeaning all together ; I am very soory for the confusion....


thanks
RRCHINTALA
ds_developer
Premium Member
Premium Member
Posts: 224
Joined: Tue Sep 24, 2002 7:32 am
Location: Denver, CO USA

Post by ds_developer »

One limitation is that it does not handle null values. You will need to test for nulls using the IsNull function or convert nulls in the parameter list using the NullToEmpty and NullToZero functions.

John
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 »

Yes! What John said is absolutely correct. You got to make sure that there are no NULL values in any of the fields of the record that you are applying CRC32 on.

Also, I have heard that there is 1 in 4 million chance of CRC32 generating the same unique number (32-bit) for two different records. But I have never experienced it and CRC32 always worked fine for me.

Hope that adds some more knowledge to all of us.

Naveen.
logic
Participant
Posts: 115
Joined: Thu Feb 24, 2005 10:48 am

Post by logic »

Hi Ranga,
Null Value handling is rather a precaution to be takeb while using CRC32. It does not limit using the function.So make sure you are handling the null values properly as john has mentioned by using nulltoempty() or nulltozero()
Ash.
mhester
Participant
Posts: 622
Joined: Tue Mar 04, 2003 5:26 am
Location: Phoenix, AZ
Contact:

Post by mhester »

It's actually 2^32 or 1 in 4,294,967,296 and that is for every row. It does not mean that an incorrect CRC will be generated if you process 4294967296 rows of data, rather each row has a 1 in 4294967296 chance. Not likely that this will fail for you.

Starbucks has been using this for 3+ years and to the best of my knowledge it has not yet failed.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Michael, you should seriously consider putting together a FAQ on this subject for the FAQs Forum. Save you repeating yourself whenever the topic comes up. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
mhester
Participant
Posts: 622
Joined: Tue Mar 04, 2003 5:26 am
Location: Phoenix, AZ
Contact:

Post by mhester »

Craig,

I might just do that - thanks :shock:
Post Reply