public class GroupByReader extends ProxyReader
DataEndpoint.State
fieldLineage, recordLineage
lastRecord, PRODUCT, PRODUCT_VERSION, VENDOR, XML_INPUT_FACTORY_KEY
BUFFER_SIZE, captureElapsedTime, DEFAULT_READ_BUFFER_SIZE
id, 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(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 |
count(String targetFieldName) |
GroupByReader |
count(String 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(String sourceFieldName,
boolean excludeNulls) |
GroupByReader |
last(String sourceFieldName,
String targetFieldName) |
GroupByReader |
last(String sourceFieldName,
String 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(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(String sourceFieldName) |
GroupByReader |
sum(String sourceFieldName,
String targetFieldName) |
String |
toString() |
available, getNestedReader, interceptRecord, map, map, setNestedDataReader, setNestedDataReader
addLineage, getBufferSize, getNestedEndpoint, getRootEndpoint, getRootReader, isExhausted, isLineageSupported, isSaveLineage, peek, pop, push, read, setSaveLineage, skip
decrementRecordCount, enableJmx, getLastRecord, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, incrementRecordCount, isRecordCountBigInteger, resetRecordCount
addElapsedtime, assertClosed, assertNotOpened, assertOpened, finalize, getClosedOn, getDescription, getElapsedTime, getElapsedTimeAsString, getOpenedOn, getOpenElapsedTime, getOpenElapsedTimeAsString, getSelfTime, getSelfTimeAsString, getState, isCaptureElapsedTime, isClosed, isOpen, setCaptureElapsedTime, setDescription
public 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(String targetFieldName)
public GroupByReader count(String targetFieldName, boolean excludeNulls)
public GroupByReader sum(String sourceFieldName, String targetFieldName)
public GroupByReader sum(String sourceFieldName)
public GroupByReader avg(String sourceFieldName, String targetFieldName)
public GroupByReader avg(String sourceFieldName, String targetFieldName, int scale, RoundingMode roundingMode)
public GroupByReader first(String sourceFieldName, String targetFieldName, boolean excludeNulls)
public GroupByReader first(String sourceFieldName, String targetFieldName)
public GroupByReader first(String sourceFieldName, boolean excludeNulls)
public GroupByReader last(String sourceFieldName, String targetFieldName, boolean excludeNulls)
public GroupByReader last(String sourceFieldName, String targetFieldName)
public GroupByReader last(String sourceFieldName, boolean excludeNulls)
public GroupByReader max(String sourceFieldName, String targetFieldName, boolean excludeNulls)
public GroupByReader max(String sourceFieldName, String targetFieldName)
public GroupByReader max(String sourceFieldName, boolean excludeNulls)
public GroupByReader max(String sourceFieldName)
public GroupByReader min(String sourceFieldName, String targetFieldName, boolean excludeNulls)
public GroupByReader min(String sourceFieldName, String targetFieldName)
public GroupByReader min(String sourceFieldName, boolean excludeNulls)
public GroupByReader min(String sourceFieldName)
public CloseWindowStrategy getCloseWindowStrategy()
public GroupByReader setCloseWindowStrategy(CloseWindowStrategy closeWindowStrategy)
public CreateWindowStrategy getCreateWindowStrategy()
public GroupByReader setCreateWindowStrategy(CreateWindowStrategy createWindowStrategy)
public long getWindowsCreated()
public long getWindowsClosed()
public void open()
DataEndpoint
open
in class ProxyReader
public void close() throws DataException
DataEndpoint
close
in class ProxyReader
DataException
protected Record readImpl() throws Throwable
DataReader
DataReader
. 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 ProxyReader
Throwable
public DataException addExceptionProperties(DataException exception)
Endpoint
DataException
. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.addExceptionProperties
in class ProxyReader
public String toString()
toString
in class DataEndpoint
Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.