Class Group.ByFields<InputT>
- java.lang.Object
-
- org.apache.beam.sdk.transforms.PTransform<PCollection<InputT>,PCollection<Row>>
-
- org.apache.beam.sdk.schemas.transforms.Group.AggregateCombiner<InputT>
-
- org.apache.beam.sdk.schemas.transforms.Group.ByFields<InputT>
-
- All Implemented Interfaces:
java.io.Serializable
,HasDisplayData
- Enclosing class:
- Group
public abstract static class Group.ByFields<InputT> extends Group.AggregateCombiner<InputT>
aPTransform
that groups schema elements based on the given fields.The output of this transform will have a key field of type
Row
containing the specified extracted fields. It will also have a value field of typeRow
containing the specified extracted fields.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.beam.sdk.transforms.PTransform
name, resourceHints
-
-
Constructor Summary
Constructors Constructor Description ByFields()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <CombineInputT,AccumT,CombineOutputT>
Group.CombineFieldsByFields<InputT>aggregateField(int inputFieldId, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, java.lang.String outputFieldName)
<CombineInputT,AccumT,CombineOutputT>
Group.CombineFieldsByFields<InputT>aggregateField(int inputFieldId, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, Schema.Field outputField)
Build up an aggregation function over the input elements.<CombineInputT,AccumT,CombineOutputT>
Group.CombineFieldsByFields<InputT>aggregateField(java.lang.String inputFieldName, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, java.lang.String outputFieldName)
Build up an aggregation function over the input elements.<CombineInputT,AccumT,CombineOutputT>
Group.CombineFieldsByFields<InputT>aggregateField(java.lang.String inputFieldName, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, Schema.Field outputField)
Build up an aggregation function over the input elements.<CombineInputT,AccumT,CombineOutputT>
Group.CombineFieldsByFields<InputT>aggregateFieldBaseValue(int inputFieldId, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, java.lang.String outputFieldName)
<CombineInputT,AccumT,CombineOutputT>
Group.CombineFieldsByFields<InputT>aggregateFieldBaseValue(int inputFieldId, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, Schema.Field outputField)
<CombineInputT,AccumT,CombineOutputT>
Group.CombineFieldsByFields<InputT>aggregateFieldBaseValue(java.lang.String inputFieldName, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, java.lang.String outputFieldName)
<CombineInputT,AccumT,CombineOutputT>
Group.CombineFieldsByFields<InputT>aggregateFieldBaseValue(java.lang.String inputFieldName, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, Schema.Field outputField)
<CombineInputT,AccumT,CombineOutputT>
Group.CombineFieldsByFields<InputT>aggregateFields(java.util.List<java.lang.String> inputFieldNames, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, java.lang.String outputFieldName)
Build up an aggregation function over the input elements.<CombineInputT,AccumT,CombineOutputT>
Group.CombineFieldsByFields<InputT>aggregateFields(java.util.List<java.lang.String> inputFieldNames, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, Schema.Field outputField)
Build up an aggregation function over the input elements.<CombineInputT,AccumT,CombineOutputT>
Group.CombineFieldsByFields<InputT>aggregateFields(FieldAccessDescriptor fieldsToAggregate, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, java.lang.String outputFieldName)
Build up an aggregation function over the input elements.<CombineInputT,AccumT,CombineOutputT>
Group.CombineFieldsByFields<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.CombineFieldsByFields<InputT>aggregateFieldsById(java.util.List<java.lang.Integer> inputFieldIds, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, java.lang.String outputFieldName)
<CombineInputT,AccumT,CombineOutputT>
Group.CombineFieldsByFields<InputT>aggregateFieldsById(java.util.List<java.lang.Integer> inputFieldIds, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, Schema.Field outputField)
Build up an aggregation function over the input elements by field id.PCollection<Row>
expand(PCollection<InputT> input)
Override this method to specify how thisPTransform
should be expanded on the givenInputT
.org.apache.beam.sdk.schemas.transforms.Group.ByFields.ToKv
getToKvs()
Group.ByFields<InputT>
withKeyField(java.lang.String keyField)
Group.ByFields<InputT>
withValueField(java.lang.String valueField)
-
Methods inherited from class org.apache.beam.sdk.transforms.PTransform
compose, compose, getAdditionalInputs, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setResourceHints, toString, validate, validate
-
-
-
-
Method Detail
-
getToKvs
public org.apache.beam.sdk.schemas.transforms.Group.ByFields.ToKv getToKvs()
-
withKeyField
public Group.ByFields<InputT> withKeyField(java.lang.String keyField)
-
withValueField
public Group.ByFields<InputT> withValueField(java.lang.String valueField)
-
aggregateField
public <CombineInputT,AccumT,CombineOutputT> Group.CombineFieldsByFields<InputT> aggregateField(java.lang.String inputFieldName, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, java.lang.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.
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.
-
aggregateFieldBaseValue
public <CombineInputT,AccumT,CombineOutputT> Group.CombineFieldsByFields<InputT> aggregateFieldBaseValue(java.lang.String inputFieldName, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, java.lang.String outputFieldName)
-
aggregateField
public <CombineInputT,AccumT,CombineOutputT> Group.CombineFieldsByFields<InputT> aggregateField(int inputFieldId, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, java.lang.String outputFieldName)
-
aggregateFieldBaseValue
public <CombineInputT,AccumT,CombineOutputT> Group.CombineFieldsByFields<InputT> aggregateFieldBaseValue(int inputFieldId, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, java.lang.String outputFieldName)
-
aggregateField
public <CombineInputT,AccumT,CombineOutputT> Group.CombineFieldsByFields<InputT> aggregateField(java.lang.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.
- Specified by:
aggregateField
in classGroup.AggregateCombiner<InputT>
-
aggregateFieldBaseValue
public <CombineInputT,AccumT,CombineOutputT> Group.CombineFieldsByFields<InputT> aggregateFieldBaseValue(java.lang.String inputFieldName, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, Schema.Field outputField)
-
aggregateField
public <CombineInputT,AccumT,CombineOutputT> Group.CombineFieldsByFields<InputT> aggregateField(int inputFieldId, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, Schema.Field outputField)
Description copied from class:Group.AggregateCombiner
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.
- Specified by:
aggregateField
in classGroup.AggregateCombiner<InputT>
-
aggregateFieldBaseValue
public <CombineInputT,AccumT,CombineOutputT> Group.CombineFieldsByFields<InputT> aggregateFieldBaseValue(int inputFieldId, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, Schema.Field outputField)
-
aggregateFields
public <CombineInputT,AccumT,CombineOutputT> Group.CombineFieldsByFields<InputT> aggregateFields(java.util.List<java.lang.String> inputFieldNames, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, java.lang.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,CombineOutputT> Group.CombineFieldsByFields<InputT> aggregateFieldsById(java.util.List<java.lang.Integer> inputFieldIds, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, java.lang.String outputFieldName)
-
aggregateFields
public <CombineInputT,AccumT,CombineOutputT> Group.CombineFieldsByFields<InputT> aggregateFields(FieldAccessDescriptor fieldsToAggregate, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, java.lang.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,CombineOutputT> Group.CombineFieldsByFields<InputT> aggregateFields(java.util.List<java.lang.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,CombineOutputT> Group.CombineFieldsByFields<InputT> aggregateFieldsById(java.util.List<java.lang.Integer> inputFieldIds, Combine.CombineFn<CombineInputT,AccumT,CombineOutputT> fn, Schema.Field outputField)
Description copied from class:Group.AggregateCombiner
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.
- Specified by:
aggregateFieldsById
in classGroup.AggregateCombiner<InputT>
-
aggregateFields
public <CombineInputT,AccumT,CombineOutputT> Group.CombineFieldsByFields<InputT> aggregateFields(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
public PCollection<Row> expand(PCollection<InputT> input)
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<Row>>
-
-