Page 1 of 1

Default non-nullable value for a Lookup Stage

Posted: Thu May 28, 2009 1:29 am
by droberts
Hi,

I am performing a lookup using a lookup stage and potentially, the values being looked up may not exist, which is fine.

I have set the stage to CONTINUE if the Lookup fails but the default value for the BIGINT field, which would have been derived from the lookup dataset, is being set to 0 (the lookup field is non-nullable) in the output.

Is there any way I can over-ride this default value in the stage itself - the manual does not offer any guidance and I cannot see any posts related to this topic. I want to set the value to -1 if the lookup fails.

If not, can a Modify stage after the lookup alter a value from 0 to -1 - again, the manual implies not. I could use a Transformer but wanted to implement a more efficient solution.

Or perhaps, is there an environment variable I can set to set a default non-nullable BIGINT to -1?

Many Thanks,

Daren

Posted: Thu May 28, 2009 5:06 am
by miwinter
Hi Daren,

I think you're stuck with it as is in this scenario, by nature of the lookup stage. It's not built for any modification of the data or otherwise, so any defaulting you'd want to do would need to come in a step after.

Cheers,

Mark

Posted: Thu May 28, 2009 5:11 am
by droberts
Hi,

Thanks, that's what I thought but thought i might as well ask :)

Daren

Posted: Thu May 28, 2009 5:15 am
by miwinter
Absolutely, that's the nature of the beast :)