Union_data
Relational functions union_data
syntax
- union_data(Domain unit, a, b, .. n)
definition
union_data(domain unit, a, b, .. n) results in a new Attribute with as Domain unit the first Argument: domainunit.
The resulting attribute contains the values of the data items a, b, .., n.
description
The first argument domainunit, is often made with the Union_unit function.
The union_data function results in an attribute with as Values unit the values units of data items a, b, ..n and as Domain unit the first argument of the function (domainunit). In other words, it appends b to a and then c to a and b, etc.
union_data(newdomain, att_old_domain) can be used to convert attributes from a source to a target domain unit.
applies to
- Unit domainunit with Value type from the group CanBeDomainUnit
- data items a, b, … n with Numeric, Point, uint2, uint4, bool or string value type
conditions
- The values unit of data items a, b, … n must match.
performance
O(n₁ + n₂ + … + nₖ) where nᵢ = number of elements in data item i. Single pass copying data from each source.
example
unit<uint32> HollandCity := union_unit(NHCity, ZHCity)
{
attribute<string> name := union_data(., NHCity/name, ZHCity/name);
}
| HollandCity/name |
|---|
| Amsterdam |
| Haarlem |
| Alkmaar |
| Rotterdam |
| DenHaag |
| Leiden |
| Dordrecht |
| Leiden |
domain HollandCity, nr of rows = 8
| NHCity/name |
|---|
| Amsterdam |
| Haarlem |
| Alkmaar |
domain NHCity, nr of rows = 3
| ZHCity/name |
|---|
| Rotterdam |
| DenHaag |
| Leiden |
| Dordrecht |
| Leiden |
domain ZHCity, nr of rows = 5