NULL trapping

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
NewPXUser
Participant
Posts: 17
Joined: Fri Feb 11, 2005 6:06 am

NULL trapping

Post by NewPXUser »

My job returned the message

When checking operator: When validating export schema: At field "inputcol": Exporting nullable field without null handling properties

I inserted a modify stage and tried both NullToValue and handle_null functions but still receive the same error. I have made a copy of the job and applied both in a transformer stage but still in vain.

Can anybody advise on where I am going wrong?

The method used is inputcol = handle_null(inputcol, 0) and
inputdesc = handle_null(inputdesc, "NULL")

Same as NullToValue in place of handle_null.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Willkommen, NewPXUser.

good job in trying to use different methods to debug your problem! I think the cause might not lie in the actual data itself but in the meta-definitions within the job. What database/stage are you writing to and in which stage is the error message generated? I am fairly certain that if you change your output to a PEEK, sequential or fileset the error will go away (it won't be solved, but you'll be a step further towards solution).
NewPXUser
Participant
Posts: 17
Joined: Fri Feb 11, 2005 6:06 am

Post by NewPXUser »

Yep.

As mentioned the same problem exists when using Sequential input and sequential output with just 10 dummy hardcoded rows - of which none are blank or null.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Hmmm... I just wrote a quickie that uses nullable input fields and wrote to a sequential file in Px... no problems...

A couple of other possibilities - what does your configuration file say about null handling? Are you using auto column propagation and dropping/adding columns?
richdhan
Premium Member
Premium Member
Posts: 364
Joined: Thu Feb 12, 2004 12:24 am

Post by richdhan »

Hi,

It is about the metadata and not about the data. The data might not be null or blank but the metadata might have the nullability set to YES.

If you are using modify stage use the following syntax

output_column=handle_null(input_column, value instead of null)

If you want the warning to be avoided when using sequential file stage then set the nullablity option that can be found in field properties column.

HTH
--Rich

Pleasure in job brings perfection in work
NewPXUser
Participant
Posts: 17
Joined: Fri Feb 11, 2005 6:06 am

Post by NewPXUser »

Yes. You were correct. The 'Nullable' property was set to 'Yes'. On making it to 'No', the warning disappeared.

Having said that, the error appear to be misleading (atleast for people like me). It says

When checking operator: When validating export schema: At field "inputcol2": Exporting nullable field without null handling properties

but I had 'null handling properties' in place by NullToValue / handle_null.

Infact if I remove the null handling routine in the tx stage, the job still works without the warning !! The input has columns to be Nullable whereas the output says 'No' to it.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

NewPXUser - I misunderstood what you had said; my test job set a column to "nullable yes " and then used null and real values so of course I didn't see any problems. And here I was looking for column propagation errors :)
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

That warning message said it exactly: If your metadata is nullable, and you're attempting to write to a flat file without handling it by means of something like "Null Field Value" on "Field defaults", then you will get a warning, even though you may not have any data with NULL.

Next time: Ensure that there's no nullable fields, OR provide the operator with a way to handle NULL.
Post Reply