I am receiving the following warning/error for each field in the stream even though I have specified the fields as non-nullable on both the input and output in this aggregator stage as well as all the other stages:
AggregateToFinPeriod: When checking operator: When binding output interface field "VEND_DISC_AMT" to field "VEND_DISC_AMT": Converting nullable source to non-nullable result; fatal runtime error could occur (use modify operator to specify value to which null should be converted)
Is it possible to eliminate this warning. IF so, how? I read the other posts regarding this error but they didn't seem to exactly match my situation.
if I remember correctly, the columns that You generate (i.e. the result of an AVG() or MAX() within the Aggregator) are always generated nullable. Your only option AFAIK would be to declare them nullable at the output of the aggregator and use a subsequent modify stage with an handle_null() operation.
You have to handle null when a null value is coming through a not null field. You can use a transformer and use the IsNull() function within the transformer to check the null value in the field. If it is null then handle the null.
Well, You _can_ use a Transformer and IsNull() in a parallel job. But if You just want to do the NULL handling, it might not be the preferred way to do in PX. Like I said above: modify and handle_null() does the trick.
Regards,
Chris
ray.wurlod wrote:That is a server-job answer to a parallel-job question in the parallel-job forum. Please take more care!
ok, handling the NULLs is obviously the right solution. I didn't realize that the values coming out of the aggregator were nullable even though I specified non-nullable.
Now, I am attempting to use the modify stage for the first time. I've read the help and am still a little confused....
I decided to use the NullToZero function so I specified
I obviously am not understanding yet how the Modify Stage works. Can someone enlighten me or point to me to chapter and verse in the manual(s) that will more thoroughly explain how to properly use the stage?
Congratulations! You found a bug in the documentation!
You cannot use NullToZero in a modify stage. This function only exists in a Transformer. Yes, they give this specific example in the documentation and Yes, it is wrong.
The syntax for modify would be:
fieldname = handle_null(fieldname, 0)
Hope that helps,
Chris
bobyon wrote:ok, handling the NULLs is obviously the right solution. I didn't realize that the values coming out of the aggregator were nullable even though I specified non-nullable.
Now, I am attempting to use the modify stage for the first time. I've read the help and am still a little confused....
I decided to use the NullToZero function so I specified
I obviously am not understanding yet how the Modify Stage works. Can someone enlighten me or point to me to chapter and verse in the manual(s) that will more thoroughly explain how to properly use the stage?