Workung with Null Values

Post Reply
Posts: 3
Joined: Wed May 20, 2015 12:55 pm

Workung with Null Values

Post by dcinbir » Fri Jul 03, 2015 12:25 pm

Dear Dr. Grawunder,

I am currently working with a Stream that contains a number of Vlaues that get converted with MAP to Float-Values or null.
When I show the Data in Odysseus Studio, I don't see any record when the source delivers values that get converted to null. The problem is, that i want to create da database-record on every Input Event, not only the "not null" event.

Like metioned in http://odysseus.informatik.uni-oldenbur ... 0848dcabe6 the COMBINE Operator has also Problem with null values, too.

Is it forbidden to work with null, or is it just a bug in the Operator?
If it is no bug, would it be possible to work with a special Object, representing "null"? Then I would have to modify the Mep-Functions thar i used in my MAP Statement, to return "Object" instead of Float. Would that be a problem for Odyssesus.

Or can I continue using null in streams but have to modify the sink to support null?

Best Regards,
Dogan Cinbir

User avatar
Marco Grawunder
Posts: 272
Joined: Tue Jul 29, 2014 10:29 am
Location: Oldenburg, Germany

Re: Workung with Null Values

Post by Marco Grawunder » Mon Jul 06, 2015 3:56 pm

"null" is allowed, but for performance reasons the will be no null check for every tuple entry.

You can use the function isNull to check, if an attribute contains a null value. So, e.g. if you want to call toFloat on an attribute that can contain null values, you should use:

Code: Select all

eif(isNull(input),null, toFloat(input))
You can switch MAP to null mode, which means that null values are allowed in the output with

Code: Select all

allowNull = true

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests