public class GroupByReader extends ProxyReader
DataEndpoint.StatefieldLineage, recordLineagelastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEYBUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZEid, log, name, TIMESTAMP_FORMAT| Constructor and Description |
|---|
GroupByReader(DataReader reader,
FieldList groupByFields) |
GroupByReader(DataReader reader,
int queueSize,
FieldList groupByFields) |
GroupByReader(DataReader reader,
int queueSize,
String... groupByFields) |
GroupByReader(DataReader reader,
String... groupByFields) |
| Modifier and Type | Method and Description |
|---|---|
GroupByReader |
add(GroupOperation<?> operation) |
DataException |
addExceptionProperties(DataException exception)
Adds this endpoint's current state to a
DataException. |
GroupByReader |
avg(FieldPath sourceFieldName,
FieldPath targetFieldName) |
GroupByReader |
avg(FieldPath sourceFieldName,
FieldPath targetFieldName,
int scale,
RoundingMode roundingMode) |
GroupByReader |
avg(String sourceFieldName,
String targetFieldName) |
GroupByReader |
avg(String sourceFieldName,
String targetFieldName,
int scale,
RoundingMode roundingMode) |
void |
close()
Indicates that this endpoint has finished reading or writing.
|
GroupByReader |
collect(FieldPath sourceFieldName,
boolean excludeNulls,
boolean distinctValues,
boolean flattenArrayValues)
Collects the individual values into an array, using the source field name as the target field name.
|
GroupByReader |
collect(FieldPath sourceFieldName,
FieldPath targetFieldName,
boolean distinctValues,
boolean flattenArrayValues)
Collects the individual values into an array, excluding nulls by default.
|
GroupByReader |
collect(FieldPath sourceFieldName,
FieldPath targetFieldName,
boolean distinctValues,
boolean flattenArrayValues,
boolean excludeNulls)
Collects the individual values into an array.
|
GroupByReader |
collect(String sourceFieldName,
boolean excludeNulls,
boolean distinctValues,
boolean flattenArrayValues)
Collects the individual values into an array, using the source field name as the target field name.
|
GroupByReader |
collect(String sourceFieldName,
String targetFieldName,
boolean distinctValues,
boolean flattenArrayValues)
Collects the individual values into an array, excluding nulls by default.
|
GroupByReader |
collect(String sourceFieldName,
String targetFieldName,
boolean distinctValues,
boolean flattenArrayValues,
boolean excludeNulls)
Collects the individual values into an array.
|
GroupByReader |
count(FieldPath targetFieldName) |
GroupByReader |
count(FieldPath targetFieldName,
boolean excludeNulls) |
GroupByReader |
count(String targetFieldName) |
GroupByReader |
count(String targetFieldName,
boolean excludeNulls) |
GroupByReader |
first(FieldPath sourceFieldName,
boolean excludeNulls) |
GroupByReader |
first(FieldPath sourceFieldName,
FieldPath targetFieldName) |
GroupByReader |
first(FieldPath sourceFieldName,
FieldPath targetFieldName,
boolean excludeNulls) |
GroupByReader |
first(String sourceFieldName,
boolean excludeNulls) |
GroupByReader |
first(String sourceFieldName,
String targetFieldName) |
GroupByReader |
first(String sourceFieldName,
String targetFieldName,
boolean excludeNulls) |
List<Window> |
getClosedWindows() |
CloseWindowStrategy |
getCloseWindowStrategy() |
CreateWindowStrategy |
getCreateWindowStrategy() |
FieldList |
getGroupByFields() |
List<Window> |
getOpenedWindows() |
List<GroupOperation<?>> |
getOperations() |
long |
getWindowsClosed() |
long |
getWindowsCreated() |
boolean |
isDebug() |
boolean |
isExcludeNulls() |
GroupByReader |
last(FieldPath sourceFieldName,
boolean excludeNulls) |
GroupByReader |
last(FieldPath sourceFieldName,
FieldPath targetFieldName) |
GroupByReader |
last(FieldPath sourceFieldName,
FieldPath targetFieldName,
boolean excludeNulls) |
GroupByReader |
last(String sourceFieldName,
boolean excludeNulls) |
GroupByReader |
last(String sourceFieldName,
String targetFieldName) |
GroupByReader |
last(String sourceFieldName,
String targetFieldName,
boolean excludeNulls) |
GroupByReader |
max(FieldPath sourceFieldName) |
GroupByReader |
max(FieldPath sourceFieldName,
boolean excludeNulls) |
GroupByReader |
max(FieldPath sourceFieldName,
FieldPath targetFieldName) |
GroupByReader |
max(FieldPath sourceFieldName,
FieldPath targetFieldName,
boolean excludeNulls) |
GroupByReader |
max(String sourceFieldName) |
GroupByReader |
max(String sourceFieldName,
boolean excludeNulls) |
GroupByReader |
max(String sourceFieldName,
String targetFieldName) |
GroupByReader |
max(String sourceFieldName,
String targetFieldName,
boolean excludeNulls) |
GroupByReader |
min(FieldPath sourceFieldName) |
GroupByReader |
min(FieldPath sourceFieldName,
boolean excludeNulls) |
GroupByReader |
min(FieldPath sourceFieldName,
FieldPath targetFieldName) |
GroupByReader |
min(FieldPath sourceFieldName,
FieldPath targetFieldName,
boolean excludeNulls) |
GroupByReader |
min(String sourceFieldName) |
GroupByReader |
min(String sourceFieldName,
boolean excludeNulls) |
GroupByReader |
min(String sourceFieldName,
String targetFieldName) |
GroupByReader |
min(String sourceFieldName,
String targetFieldName,
boolean excludeNulls) |
void |
open()
Makes this endpoint ready for reading or writing.
|
protected Record |
readImpl()
Overridden by subclasses to read the next record from this
DataReader. |
GroupByReader |
setCloseWindowStrategy(CloseWindowStrategy closeWindowStrategy) |
GroupByReader |
setCreateWindowStrategy(CreateWindowStrategy createWindowStrategy) |
GroupByReader |
setDebug(boolean debug) |
GroupByReader |
setExcludeNulls(boolean excludeNulls)
Indicates if
null groups should be excluded from results (defaults to false). |
GroupByReader |
sum(FieldPath sourceFieldName) |
GroupByReader |
sum(FieldPath sourceFieldName,
FieldPath targetFieldName) |
GroupByReader |
sum(String sourceFieldName) |
GroupByReader |
sum(String sourceFieldName,
String targetFieldName) |
String |
toString() |
available, getNestedReader, interceptRecord, map, map, setNestedDataReader, setNestedDataReaderaddLineage, getBufferSize, getNestedEndpoint, getReader, getRootEndpoint, getRootReader, isExhausted, isLineageSupported, isSaveLineage, peek, pop, push, read, setSaveLineage, skipdecrementRecordCount, enableJmx, getLastRecord, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, incrementRecordCount, isRecordCountBigInteger, resetRecordCountaddElapsedtime, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescriptionpublic GroupByReader(DataReader reader, String... groupByFields)
public GroupByReader(DataReader reader, int queueSize, String... groupByFields)
public GroupByReader(DataReader reader, FieldList groupByFields)
public GroupByReader(DataReader reader, int queueSize, FieldList groupByFields)
public FieldList getGroupByFields()
public boolean isExcludeNulls()
public GroupByReader setExcludeNulls(boolean excludeNulls)
null groups should be excluded from results (defaults to false). For example,
when grouping on country and city, any cases where both country and city are null will be skipped if
set to true.public boolean isDebug()
public GroupByReader setDebug(boolean debug)
public List<GroupOperation<?>> getOperations()
public GroupByReader add(GroupOperation<?> operation)
public GroupByReader count(FieldPath targetFieldName)
public GroupByReader count(String targetFieldName)
public GroupByReader count(FieldPath targetFieldName, boolean excludeNulls)
public GroupByReader count(String targetFieldName, boolean excludeNulls)
public GroupByReader sum(FieldPath sourceFieldName, FieldPath targetFieldName)
public GroupByReader sum(FieldPath sourceFieldName)
public GroupByReader sum(String sourceFieldName, String targetFieldName)
public GroupByReader sum(String sourceFieldName)
public GroupByReader avg(FieldPath sourceFieldName, FieldPath targetFieldName)
public GroupByReader avg(String sourceFieldName, String targetFieldName)
public GroupByReader avg(FieldPath sourceFieldName, FieldPath targetFieldName, int scale, RoundingMode roundingMode)
public GroupByReader avg(String sourceFieldName, String targetFieldName, int scale, RoundingMode roundingMode)
public GroupByReader first(FieldPath sourceFieldName, FieldPath targetFieldName, boolean excludeNulls)
public GroupByReader first(String sourceFieldName, String targetFieldName, boolean excludeNulls)
public GroupByReader first(FieldPath sourceFieldName, FieldPath targetFieldName)
public GroupByReader first(String sourceFieldName, String targetFieldName)
public GroupByReader first(FieldPath sourceFieldName, boolean excludeNulls)
public GroupByReader first(String sourceFieldName, boolean excludeNulls)
public GroupByReader last(FieldPath sourceFieldName, FieldPath targetFieldName, boolean excludeNulls)
public GroupByReader last(String sourceFieldName, String targetFieldName, boolean excludeNulls)
public GroupByReader last(FieldPath sourceFieldName, FieldPath targetFieldName)
public GroupByReader last(String sourceFieldName, String targetFieldName)
public GroupByReader last(FieldPath sourceFieldName, boolean excludeNulls)
public GroupByReader last(String sourceFieldName, boolean excludeNulls)
public GroupByReader max(FieldPath sourceFieldName, FieldPath targetFieldName, boolean excludeNulls)
public GroupByReader max(String sourceFieldName, String targetFieldName, boolean excludeNulls)
public GroupByReader max(FieldPath sourceFieldName, FieldPath targetFieldName)
public GroupByReader max(String sourceFieldName, String targetFieldName)
public GroupByReader max(FieldPath sourceFieldName, boolean excludeNulls)
public GroupByReader max(String sourceFieldName, boolean excludeNulls)
public GroupByReader max(FieldPath sourceFieldName)
public GroupByReader max(String sourceFieldName)
public GroupByReader min(FieldPath sourceFieldName, FieldPath targetFieldName, boolean excludeNulls)
public GroupByReader min(String sourceFieldName, String targetFieldName, boolean excludeNulls)
public GroupByReader min(FieldPath sourceFieldName, FieldPath targetFieldName)
public GroupByReader min(String sourceFieldName, String targetFieldName)
public GroupByReader min(FieldPath sourceFieldName, boolean excludeNulls)
public GroupByReader min(String sourceFieldName, boolean excludeNulls)
public GroupByReader min(FieldPath sourceFieldName)
public GroupByReader min(String sourceFieldName)
public GroupByReader collect(FieldPath sourceFieldName, FieldPath targetFieldName, boolean distinctValues, boolean flattenArrayValues, boolean excludeNulls)
sourceFieldName - the path of the field to collect values fromtargetFieldName - the path of the field where the collected array will be placeddistinctValues - true to collect only distinct values, false to allow duplicatesflattenArrayValues - true to flatten array values (add elements individually instead of as nested arrays)excludeNulls - true to exclude null values from the collectionGroupCollectpublic GroupByReader collect(String sourceFieldName, String targetFieldName, boolean distinctValues, boolean flattenArrayValues, boolean excludeNulls)
sourceFieldName - the name of the field to collect values fromtargetFieldName - the name of the field where the collected array will be placeddistinctValues - true to collect only distinct values, false to allow duplicatesflattenArrayValues - true to flatten array values (add elements individually instead of as nested arrays)excludeNulls - true to exclude null values from the collectionGroupCollectpublic GroupByReader collect(FieldPath sourceFieldName, FieldPath targetFieldName, boolean distinctValues, boolean flattenArrayValues)
sourceFieldName - the path of the field to collect values fromtargetFieldName - the path of the field where the collected array will be placeddistinctValues - true to collect only distinct values, false to allow duplicatesflattenArrayValues - true to flatten array values (add elements individually instead of as nested arrays)GroupCollectpublic GroupByReader collect(String sourceFieldName, String targetFieldName, boolean distinctValues, boolean flattenArrayValues)
sourceFieldName - the name of the field to collect values fromtargetFieldName - the name of the field where the collected array will be placeddistinctValues - true to collect only distinct values, false to allow duplicatesflattenArrayValues - true to flatten array values (add elements individually instead of as nested arrays)GroupCollectpublic GroupByReader collect(FieldPath sourceFieldName, boolean excludeNulls, boolean distinctValues, boolean flattenArrayValues)
sourceFieldName - the path of the field to collect values from and place the result inexcludeNulls - true to exclude null values from the collectiondistinctValues - true to collect only distinct values, false to allow duplicatesflattenArrayValues - true to flatten array values (add elements individually instead of as nested arrays)GroupCollectpublic GroupByReader collect(String sourceFieldName, boolean excludeNulls, boolean distinctValues, boolean flattenArrayValues)
sourceFieldName - the name of the field to collect values from and place the result inexcludeNulls - true to exclude null values from the collectiondistinctValues - true to collect only distinct values, false to allow duplicatesflattenArrayValues - true to flatten array values (add elements individually instead of as nested arrays)GroupCollectpublic CloseWindowStrategy getCloseWindowStrategy()
public GroupByReader setCloseWindowStrategy(CloseWindowStrategy closeWindowStrategy)
public CreateWindowStrategy getCreateWindowStrategy()
public GroupByReader setCreateWindowStrategy(CreateWindowStrategy createWindowStrategy)
public long getWindowsCreated()
public long getWindowsClosed()
public void open()
DataEndpointopen in class ProxyReaderpublic void close()
throws DataException
DataEndpointclose in class ProxyReaderDataExceptionprotected Record readImpl() throws Throwable
DataReaderDataReader. The default
implementation of DataReader.read() now insures that this method will not be called again after it returns
a null.
If no record is available, null will be returned.
readImpl in class ProxyReaderThrowablepublic DataException addExceptionProperties(DataException exception)
EndpointDataException. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.addExceptionProperties in class ProxyReaderpublic String toString()
toString in class DataEndpointCopyright (c) 2006-2026 North Concepts Inc. All Rights Reserved.