Class Group.AggregateCombiner<InputT>
java.lang.Object
org.apache.beam.sdk.transforms.PTransform<PCollection<InputT>,PCollection<Row>>
org.apache.beam.sdk.schemas.transforms.Group.AggregateCombiner<InputT>
- Type Parameters:
InputT
-
- All Implemented Interfaces:
Serializable
,HasDisplayData
- Direct Known Subclasses:
Group.ByFields
,Group.CombineFieldsByFields
,Group.CombineFieldsGlobally
- Enclosing class:
Group
public abstract static class Group.AggregateCombiner<InputT>
extends PTransform<PCollection<InputT>,PCollection<Row>>
a
PTransform
that does a combine using an aggregation built up by calls to
aggregateField and aggregateFields. The output of this transform will have a schema that is
determined by the output types of all the composed combiners.- See Also:
-
Field Summary
Fields inherited from class org.apache.beam.sdk.transforms.PTransform
annotations, displayData, name, resourceHints
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract <CombineInputT,
AccumT, CombineOutputT>
Group.AggregateCombiner<InputT> aggregateField
(int inputFieldId, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, Schema.Field outputField) Build up an aggregation function over the input elements.abstract <CombineInputT,
AccumT, CombineOutputT>
Group.AggregateCombiner<InputT> aggregateField
(String inputFieldName, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, Schema.Field outputField) Build up an aggregation function over the input elements.abstract <CombineInputT,
AccumT, CombineOutputT>
Group.AggregateCombiner<InputT> aggregateFieldsById
(List<Integer> inputFieldIds, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, Schema.Field outputField) Build up an aggregation function over the input elements by field id.Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, expand, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
-
Constructor Details
-
AggregateCombiner
public AggregateCombiner()
-
-
Method Details
-
aggregateField
public abstract <CombineInputT,AccumT, Group.AggregateCombiner<InputT> aggregateFieldCombineOutputT> (int inputFieldId, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, Schema.Field outputField) Build up an aggregation function over the input elements.This method specifies an aggregation over single field of the input. The union of all calls to aggregateField and aggregateFields will determine the output schema.
-
aggregateField
public abstract <CombineInputT,AccumT, Group.AggregateCombiner<InputT> aggregateFieldCombineOutputT> (String inputFieldName, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, Schema.Field outputField) Build up an aggregation function over the input elements.This method specifies an aggregation over single field of the input. The union of all calls to aggregateField and aggregateFields will determine the output schema.
-
aggregateFieldsById
public abstract <CombineInputT,AccumT, Group.AggregateCombiner<InputT> aggregateFieldsByIdCombineOutputT> (List<Integer> inputFieldIds, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, Schema.Field outputField) Build up an aggregation function over the input elements by field id.This method specifies an aggregation over multiple fields of the input. The union of all calls to aggregateField and aggregateFields will determine the output schema.
Field types in the output schema will be inferred from the provided combine function. Sometimes the field type cannot be inferred due to Java's type erasure. In that case, use the overload that allows setting the output field type explicitly.
-