Project

General

Profile

Actions

Bug #2240

closed

add support for null values to data passing among ports

Added by Matt Jones about 19 years ago. Updated over 18 years ago.

Status:
Resolved
Priority:
Immediate
Category:
core
Target version:
Start date:
11/02/2005
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
2240

Description

Currently ptolemy and kepler do not support passing null values (sometimes
called missing values) among ports, even though this is common in analytical
systems like R and SAS. The concept of null is not even defined in the token
types. This causes a real problem for data sources that are sparsely populated,
as well as data streams that result from data integration operations that might
produce null values. We need to extend the underlying token representation to
include a concept of null values and the actor framework to protect existing
actors that might not know how to handle null values. Because nulls cannot
currently be represented in Kepler, none of the existing actors support them.
An exception is thrown whenever a missing value is detected by the EML data
source, and workflow execution ceases.

Bowers and Jones discussed one possible partial solution to this on IRC, which
is summarized here.

1) Override the Token base class to support null values by providing two new
methods:
Token.null() sets the token's value to null
boolean Token.isNull() returns true if the token has been set to null

2) Override TypedIOPort to add a new method that takes a boolean "dropNull"
a) by default this could be set to "true"
then the existing get() method would be reimplemented to call the new one
with a default of "true" because we can assume that no existing actor written
can handle null values, since there is no way to pass null values, and so
existing calls to get() will invisibly drop null values.

b) if an actor can handle null values, then it passes "false" 
which indicates that the actor knows how to deal with nulls and wants to
receive them
so the changes to IOPort (or maybe TypedIOPOrt) would be:

IOPOrt.get(channelindex) becomes get(channelIndex, dropNullValues)
and
IOPort.get(channelIndex, int vectorLength) becomes get(channelIndex,
vectorLength, dropNullValues)

so, for example, the new implmenetation of get(channelIndex) would simply call
get(channelIndex, true), so existing actors would not even notice the change.


Related issues

Blocked by Kepler - Bug #2171: Add support for missingValueCode in EML parserResolvedJing Tao08/15/2005

Actions
Actions

Also available in: Atom PDF