Class GroupCollect
java.lang.Object
com.northconcepts.datapipeline.group.GroupOperation<ArrayValue>
com.northconcepts.datapipeline.group.operation.GroupCollect
Collects the individual values into an array.
Supports options for collecting distinct values, flattening array values, and excluding nulls.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGroupCollect(FieldPath sourceFieldName) Creates a GroupCollect operation for the specified source field path.GroupCollect(FieldPath sourceFieldName, FieldPath targetFieldName) Creates a GroupCollect operation with source and target field paths.GroupCollect(FieldPath sourceFieldName, FieldPath targetFieldName, boolean excludeNulls) Creates a GroupCollect operation with source and target field paths and null exclusion option.GroupCollect(String sourceFieldName) Creates a GroupCollect operation for the specified source field.GroupCollect(String sourceFieldName, String targetFieldName) Creates a GroupCollect operation with source and target field names.GroupCollect(String sourceFieldName, String targetFieldName, boolean excludeNulls) Creates a GroupCollect operation with source and target field names and null exclusion option. -
Method Summary
Modifier and TypeMethodDescriptionprotected GroupOperationField<ArrayValue> Creates the accumulator that computes this operation's result for one group; called once per group in each window.booleanReturns whether only distinct values are collected.booleanReturns whether array values should be flattened during collection.setDistinctValues(boolean distinctValues) Sets whether only distinct values should be collected.setFlattenArrayValues(boolean flattenArrayValues) Sets whether array values should be flattened during collection.toString()Methods inherited from class com.northconcepts.datapipeline.group.GroupOperation
getExcludeNulls, getFilter, getSourceFieldName, getSourceFieldPath, getTargetFieldName, getTargetFieldPath, setExcludeNulls, setFilter, setTargetFieldName
-
Constructor Details
-
GroupCollect
Creates a GroupCollect operation for the specified source field.- Parameters:
sourceFieldName- the name of the source field to collect values from
-
GroupCollect
Creates a GroupCollect operation for the specified source field path.- Parameters:
sourceFieldName- the path of the source field to collect values from
-
GroupCollect
Creates a GroupCollect operation with source and target field names.- Parameters:
sourceFieldName- the name of the source field to collect values fromtargetFieldName- the name of the target field where the array will be placed
-
GroupCollect
Creates a GroupCollect operation with source and target field paths.- Parameters:
sourceFieldName- the path of the source field to collect values fromtargetFieldName- the path of the target field where the array will be placed
-
GroupCollect
Creates a GroupCollect operation with source and target field names and null exclusion option.- Parameters:
sourceFieldName- the name of the source field to collect values fromtargetFieldName- the name of the target field where the array will be placedexcludeNulls- true to exclude null values from the collection, false to include them
-
GroupCollect
Creates a GroupCollect operation with source and target field paths and null exclusion option.- Parameters:
sourceFieldName- the path of the source field to collect values fromtargetFieldName- the path of the target field where the array will be placedexcludeNulls- true to exclude null values from the collection, false to include them
-
-
Method Details
-
isDistinctValues
public boolean isDistinctValues()Returns whether only distinct values are collected. When true, duplicate values are excluded from the collection.- Returns:
- true if collecting only distinct values, false otherwise
-
setDistinctValues
Sets whether only distinct values should be collected.- Parameters:
distinctValues- true to collect only distinct values, false to allow duplicates- Returns:
- this GroupCollect instance for method chaining
-
isFlattenArrayValues
public boolean isFlattenArrayValues()Returns whether array values should be flattened during collection. When true, array elements are added individually instead of as nested arrays.- Returns:
- true if flattening array values, false otherwise
-
setFlattenArrayValues
Sets whether array values should be flattened during collection.- Parameters:
flattenArrayValues- true to flatten array values, false to keep them nested- Returns:
- this GroupCollect instance for method chaining
-
createField
Description copied from class:GroupOperationCreates the accumulator that computes this operation's result for one group; called once per group in each window.- Specified by:
createFieldin classGroupOperation<ArrayValue>
-
toString
- Overrides:
toStringin classGroupOperation<ArrayValue>
-