CollectionTRecord, TTimeGroupByTKey, TOutput Method (ExpressionFuncTRecord, TKey, FuncTKey, IEnumerableTRecord, IEnumerableTOutput)Naiad Help

[This is preliminary documentation and is subject to change.]

Groups records using the supplied key selector, and applies the given reduction function.

Namespace: Microsoft.Research.Naiad.Frameworks.DifferentialDataflow
Assembly: Microsoft.Research.Naiad.DifferentialDataflow (in Microsoft.Research.Naiad.DifferentialDataflow.dll) Version: 0.5.0.0 (0.5.0.0)
Syntax

C#
Collection<TOutput, TTime> GroupBy<TKey, TOutput>(
	Expression<Func<TRecord, TKey>> keySelector,
	Func<TKey, IEnumerable<TRecord>, IEnumerable<TOutput>> reducer
)
where TKey : Object, IEquatable<TKey>
where TOutput : Object, IEquatable<TOutput>

Parameters

keySelector
Type: System.Linq.ExpressionsExpressionFuncTRecord, TKey
Function that extracts a key from each record.
reducer
Type: SystemFuncTKey, IEnumerableTRecord, IEnumerableTOutput
Function that transforms a sequence of input records to a sequence of output records.

Type Parameters

TKey
The key type.
TOutput
The result type.

Return Value

Type: CollectionTOutput, TTime
The collection of output records for each group in the input collection.
Remarks

The GroupByTKey, TValue, TOutput(ExpressionFuncTRecord, TKey, ExpressionFuncTRecord, TValue, FuncTKey, IEnumerableTValue, IEnumerableTOutput) overload can reduce the amount of storage required compared to this overload in cases where the intermediate value is small relative to each original record. If the reducer is a commutative and associative aggregation function, consider using the AggregateTKey, TValue, TOutput(ExpressionFuncTRecord, TKey, ExpressionFuncTRecord, TValue, ExpressionFuncInt64, TValue, TValue, TValue, ExpressionFuncTValue, Boolean, ExpressionFuncTKey, TValue, TOutput) (or a related aggregation) operator, which stores a single value for each key, rather than a sequence of values.
See Also

Reference

CollectionTRecord, TTimeMaxTKey, TComparable, TValue(ExpressionFuncTRecord, TKey, ExpressionFuncTRecord, TValue, ExpressionFuncTKey, TValue, TComparable, ExpressionFuncTKey, TValue, TRecord)
CollectionTRecord, TTimeMinTKey, TComparable, TValue(ExpressionFuncTRecord, TKey, ExpressionFuncTRecord, TValue, ExpressionFuncTKey, TValue, TComparable, ExpressionFuncTKey, TValue, TRecord)
CollectionTRecord, TTimeSumTKey, TOutput(ExpressionFuncTRecord, TKey, ExpressionFuncTRecord, Int32, ExpressionFuncTKey, Int32, TOutput)