-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Analogous to existing standard aggregation methods in sections [3.2.1.3 Aggregation Methods] we introduce a union
aggregation method that collects (aggregates) the values into a collection with no repeated values and a non-deterministic ordering.
The terminology is derived from the fact that this aggregation is a repeated union operation of representations of mathematical sets.
For example, given a nested collection of primitive types, with a schema like the following.
<EntityType Name="Product">
<Key>
<PropertyRef Name="ID"/>
</Key>
<Property Name="ID" Type="Edm.Int32" Nullable="false"/>
<Property Name="Name" Type="Edm.String"/>
<Property Name="Color" Type="Edm.String"/>
<Property Name="Tags" Type="Collection(Edm.String)"/>
</EntityType>
and
<EntitySet Name="Products" EntityType="Namespace.Product"/>
The request
GET /service/Products?$apply=aggregate(tags with union as DistinctTags)
will result in :
{
"@context": "$metadata#Products(DistinctTags)",
"value": [
{"DistinctTags": ["Produce", "Groceries", "GiftShop"]}
]
}
Analogous to countdistinct:
Instance comparison uses the definition of equality in OData-URL, section 5.1.1.1.1.
Metadata
Metadata
Assignees
Labels
No labels