Class Group.Global<InputT>
- All Implemented Interfaces:
Serializable
,HasDisplayData
- Enclosing class:
Group
PTransform
for doing global aggregations on schema PCollections.- 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 TypeMethodDescription<OutputT> Group.CombineGlobally
<InputT, OutputT> aggregate
(Combine.CombineFn<InputT, ?, OutputT> combineFn) Aggregate the grouped data using the specifiedCombine.CombineFn
.<CombineInputT,
AccumT, CombineOutputT>
Group.CombineFieldsGlobally<InputT> aggregateField
(int inputFieldId, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, String outputFieldName) <CombineInputT,
AccumT, CombineOutputT>
Group.CombineFieldsGlobally<InputT> aggregateField
(int inputFielId, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, Schema.Field outputField) <CombineInputT,
AccumT, CombineOutputT>
Group.CombineFieldsGlobally<InputT> aggregateField
(String inputFieldName, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, String outputFieldName) Build up an aggregation function over the input elements.<CombineInputT,
AccumT, CombineOutputT>
Group.CombineFieldsGlobally<InputT> aggregateField
(String inputFieldName, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, Schema.Field outputField) Build up an aggregation function over the input elements.<CombineInputT,
AccumT, CombineOutputT>
Group.CombineFieldsGlobally<InputT> aggregateFieldBaseValue
(int inputFieldId, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, String outputFieldName) <CombineInputT,
AccumT, CombineOutputT>
Group.CombineFieldsGlobally<InputT> aggregateFieldBaseValue
(int inputFielId, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, Schema.Field outputField) <CombineInputT,
AccumT, CombineOutputT>
Group.CombineFieldsGlobally<InputT> aggregateFieldBaseValue
(String inputFieldName, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, String outputFieldName) <CombineInputT,
AccumT, CombineOutputT>
Group.CombineFieldsGlobally<InputT> aggregateFieldBaseValue
(String inputFieldName, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, Schema.Field outputField) <CombineInputT,
AccumT, CombineOutputT>
Group.CombineFieldsGlobally<InputT> aggregateFields
(List<String> inputFieldNames, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, String outputFieldName) Build up an aggregation function over the input elements.<CombineInputT,
AccumT, CombineOutputT>
Group.CombineFieldsGlobally<InputT> aggregateFields
(List<String> inputFieldNames, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, Schema.Field outputField) Build up an aggregation function over the input elements.<CombineInputT,
AccumT, CombineOutputT>
Group.CombineFieldsGlobally<InputT> aggregateFields
(FieldAccessDescriptor fieldsToAggregate, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, String outputFieldName) Build up an aggregation function over the input elements.<CombineInputT,
AccumT, CombineOutputT>
Group.CombineFieldsGlobally<InputT> aggregateFields
(FieldAccessDescriptor fieldsToAggregate, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, Schema.Field outputField) Build up an aggregation function over the input elements.<CombineInputT,
AccumT, CombineOutputT>
Group.CombineFieldsGlobally<InputT> aggregateFieldsById
(List<Integer> inputFieldIds, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, String outputFieldName) <CombineInputT,
AccumT, CombineOutputT>
Group.CombineFieldsGlobally<InputT> aggregateFieldsById
(List<Integer> inputFieldIds, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, Schema.Field outputField) expand
(PCollection<InputT> input) Override this method to specify how thisPTransform
should be expanded on the givenInputT
.Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
-
Constructor Details
-
Global
public Global()
-
-
Method Details
-
aggregate
public <OutputT> Group.CombineGlobally<InputT,OutputT> aggregate(Combine.CombineFn<InputT, ?, OutputT> combineFn) Aggregate the grouped data using the specifiedCombine.CombineFn
. The resultingPCollection
will have type OutputT. -
aggregateField
public <CombineInputT,AccumT, Group.CombineFieldsGlobally<InputT> aggregateFieldCombineOutputT> (String inputFieldName, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, String outputFieldName) 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.
-
aggregateFieldBaseValue
public <CombineInputT,AccumT, Group.CombineFieldsGlobally<InputT> aggregateFieldBaseValueCombineOutputT> (String inputFieldName, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, String outputFieldName) -
aggregateField
public <CombineInputT,AccumT, Group.CombineFieldsGlobally<InputT> aggregateFieldCombineOutputT> (int inputFieldId, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, String outputFieldName) -
aggregateFieldBaseValue
public <CombineInputT,AccumT, Group.CombineFieldsGlobally<InputT> aggregateFieldBaseValueCombineOutputT> (int inputFieldId, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, String outputFieldName) -
aggregateField
public <CombineInputT,AccumT, Group.CombineFieldsGlobally<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.
-
aggregateFieldBaseValue
public <CombineInputT,AccumT, Group.CombineFieldsGlobally<InputT> aggregateFieldBaseValueCombineOutputT> (String inputFieldName, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, Schema.Field outputField) -
aggregateField
public <CombineInputT,AccumT, Group.CombineFieldsGlobally<InputT> aggregateFieldCombineOutputT> (int inputFielId, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, Schema.Field outputField) -
aggregateFieldBaseValue
public <CombineInputT,AccumT, Group.CombineFieldsGlobally<InputT> aggregateFieldBaseValueCombineOutputT> (int inputFielId, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, Schema.Field outputField) -
aggregateFields
public <CombineInputT,AccumT, Group.CombineFieldsGlobally<InputT> aggregateFieldsCombineOutputT> (List<String> inputFieldNames, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, String outputFieldName) Build up an aggregation function over the input elements.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.
-
aggregateFieldsById
public <CombineInputT,AccumT, Group.CombineFieldsGlobally<InputT> aggregateFieldsByIdCombineOutputT> (List<Integer> inputFieldIds, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, String outputFieldName) -
aggregateFields
public <CombineInputT,AccumT, Group.CombineFieldsGlobally<InputT> aggregateFieldsCombineOutputT> (FieldAccessDescriptor fieldsToAggregate, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, String outputFieldName) Build up an aggregation function over the input elements.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.
-
aggregateFields
public <CombineInputT,AccumT, Group.CombineFieldsGlobally<InputT> aggregateFieldsCombineOutputT> (List<String> inputFieldNames, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, Schema.Field outputField) Build up an aggregation function over the input elements.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.
-
aggregateFieldsById
public <CombineInputT,AccumT, Group.CombineFieldsGlobally<InputT> aggregateFieldsByIdCombineOutputT> (List<Integer> inputFieldIds, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, Schema.Field outputField) -
aggregateFields
public <CombineInputT,AccumT, Group.CombineFieldsGlobally<InputT> aggregateFieldsCombineOutputT> (FieldAccessDescriptor fieldsToAggregate, Combine.CombineFn<CombineInputT, AccumT, CombineOutputT> fn, Schema.Field outputField) Build up an aggregation function over the input elements.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.
-
expand
Description copied from class:PTransform
Override this method to specify how thisPTransform
should be expanded on the givenInputT
.NOTE: This method should not be called directly. Instead apply the
PTransform
should be applied to theInputT
using theapply
method.Composite transforms, which are defined in terms of other transforms, should return the output of one of the composed transforms. Non-composite transforms, which do not apply any transforms internally, should return a new unbound output and register evaluators (via backend-specific registration methods).
- Specified by:
expand
in classPTransform<PCollection<InputT>,
PCollection<Iterable<InputT>>>
-