Varunion
Combines contents of two or more relations with similar schemas.
Usage
varunion ((rel1, rel2, ...) : unioned-data)
Details
Returns all tuples from the set that represents the
combination of relations.
Notes
- If relations do not have the same schema, errors will occur.
- By definition, sets are composed of unique elements - thus,
duplicates will not be returned.
Known Bugs
Example
Using the input:
RELATION books1: 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
RELATION books2: title char, author char, pub_date date, pages number
Title3|Author2|05-09-2002|733
Title4|Author3|01-01-1968|32
Title6|Author4|03-14-1977|168
Title7|Author4|07-23-1999|332
RELATION books3: title char, author char, pub_date date, pages number
Title9|Author9|01-02-2003|123
when executing the plan:
PLAN test
{
INPUT: stream books1, stream books2, stream books3
OUTPUT: stream answer
BODY
{
varunion ((books1, books2, books3) : answer)
}
}
will generate the following output:
----------------------------------------------
RELATION: test_answer
attrs: title, author, pub_date, pages
----------------------------------------------
Title2|Author2|12-23-1954|479
Title4|Author3|01-01-1968|32
Title1|Author1|09-01-1991|34
Title3|Author2|05-09-2002|733
Title5|Author2|07-03-2001|1152
Title6|Author4|03-14-1977|168
Title7|Author4|07-23-1999|332
Title9|Author9|01-02-2003|123
----------------------------------------------