Replace null

library operator
ID: 08f7de95-0fa0-4606-afab-da39f4280f21
Replaces null items with specified value in a stream of primitive items.

Behavior

Test data showing the behavior of Replace null

Integers

It replaces null values for integers (in this case with -1).

Input Output
1 1
null -1
2 2
Strings

It replaces null values for strings (in this case with empty strings).

Input Output
null ""
"a" "a"
"b" "b"
null ""

Implementation

The implementation of Replace null makes use of the following 3 operators.

1
Emits a constant value for each item.
1
Emits either the first or the second item depending on the given boolean.
1
Emits true only if a given primitive is null.