Page 1 of 1

Null value appeared as '0' for integer column

Posted: Tue Nov 09, 2010 5:53 pm
by GowthamSen
Hi,

I created a simple job where I have two sources (defined as sequential file stages), a Join stage ( doing Outer joins) and then loading the final output to a sequential file stage.

Everything works fine. As I am using outer joins I am expecting null values. There is a record where null values should be appeared.

For Varchar fields the null value is appeared as blank. But the null value for Integer variable is appeared as '0' in the file.

Not sure why its coming like this. I am using all default settings for sequential file stage.

Please help me in this.

Posted: Wed Nov 10, 2010 2:15 am
by Sreenivasulu
In the default tab of the sequential file 'default null value would have been set to zero'.
You can set this to '' so that null value is stored as 'empty'

Regards
Sreeni

Posted: Wed Nov 10, 2010 1:07 pm
by GowthamSen
Hi,

Nope, No default value is set. Even I tried this option by manually setting it, its the same.

I believe that, this value is being set as 0 in Join stage. Is there any way we can debug and find out how the data is changing?

As its a parallel job there is no debug option. I am wondering how we can do this in this scenario.?

Thanks a lot!

Posted: Wed Nov 10, 2010 3:30 pm
by dougcl
Make sure the column on your join input and output links says Nullable=Yes.

Posted: Wed Nov 10, 2010 4:09 pm
by mhester
That is the default behavior when going from a nullable input to a not nullable output and the input value is null.

Same in the lookup, merge etc...

Has nothing to do with your sequential stage.