Converting a nullable source to a non-nullable result....

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
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

Converting a nullable source to a non-nullable result....

Post by kaps »

I am facing a problem when using Lookup stage. Job design is Seq file, join stage(with seq file), look up stage(with DB2 Connector stage) and few other join stages after that.
In the lookup stage, I am doing range lookup on the Version From and To dates in the table with a date field(appl date) comes out of join stage.
I have the Version from and to dates and the appl date all defined as nullable in the table definition. I understand that these fields can't be NULL and we are correcting it but why would it give such a warning ?
When checking operator: When binding input interface field "VERSION_FROM_DATE" to field "VERSION_FROM_DATE": Converting a nullable source to a non-nullable result;
a fatal runtime error could occur;
use a modify operator to specify the value to which the null should be converted.
and then failed with the error :
Null in field "VERSION_FROM_DATE "; the result is non-nullable
and there is no handle_null to specify a default value.
Null in field "VERSION_TO_DATE "; the result is non-nullable
and there is no handle_null to specify a default value.
So, I had changed sql in DB2 connector stage to give a default value if version from and to dates are null. Now the job does not fail but I still have the same warning.

My questions are:

1. Why would it throw above warning and the error when all those fields are nullable ?
Is it because those fields are used in the range lookup ?

2. How can I get rid of the warning message ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's not about whether no nulls appear in the data. This warning is driven by the metadata. You have to make the receiving columns Nullable if there is any possibility (that is, any upstream Nullable column that feeds them) of a Null arriving, even though you know there aren't any.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You'll have the same issue with any kind of derived field, like a sum for example. Even if you are summing non-nullable fields, it will always consider the result to be nullable.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kaps
Participant
Posts: 452
Joined: Tue May 10, 2005 12:36 pm

Post by kaps »

What I don't understand is that the columns are nullable even in the database but it spits the error message as :
Converting a nullable source to a non-nullable result

These columns are not propagated further down and it's just used for range lookup. Why does it throw entirely opposite warning ?

Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Read EVERYTHING in the error message. We know the column that's throwing the warning, but in which stage?
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