Null
Routes one of two relations based on the contents of a third.
Usage
null (test, lhs, rhs : out-yes, out-no)
Details
If test contains zero tuples, then lhs is routed as
the variable out-yes, otherwise the variable rhs will
be routed as out-no.
Notes
- The same named stream can be used for test, lhs,
and rhs if so desired.
Known Bugs
Example
Using the input:
RELATION books: title char, author char, pub_date date, pages number
Title1|Author1|09-01-1991|34
Title2|Author2|12-23-1954|479
Title3|Author2|05-09-2002|733
Title4|Author3|01-01-1968|32
Title5|Author2|07-03-2001|1152
when executing the plan:
PLAN test
{
INPUT: stream books
OUTPUT: stream answer
BODY
{
select (books, "pages < 10" : selected-books)
null (selected-books, "no books!", selected-books : answer, answer)
}
}
will generate the following output:
----------------------------------------------
RELATION: test_answer
attrs: dummy
----------------------------------------------
no books!
----------------------------------------------