|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.base.node.preproc.groupby.GroupByTable
public class GroupByTable
A data table that groups a given input table by the given columns
and calculates the aggregation values of the remaining rows. Call the
getBufferedTable()
method after instance creation to get the
grouped table. If the enableHilite flag was set to true
call
the getHiliteMapping()
method to get the row key translation
Map
. Call the getSkippedGroupsByColName()
method
to get a Map
with all skipped groups or the
getSkippedGroupsMessage(int, int)
for a appropriate warning message.
Constructor Summary | |
---|---|
GroupByTable(ExecutionContext exec,
BufferedDataTable inDataTable,
List<String> groupByCols,
ColumnAggregator[] colAggregators,
int maxUniqueValues,
boolean sortInMemory,
boolean enableHilite,
ColumnNamePolicy colNamePolicy)
Constructor for class GroupByTable. |
|
GroupByTable(ExecutionContext exec,
BufferedDataTable inDataTable,
List<String> groupByCols,
ColumnAggregator[] colAggregators,
int maxUniqueValues,
boolean sortInMemory,
boolean enableHilite,
ColumnNamePolicy colNamePolicy,
boolean retainOrder)
Constructor for class GroupByTable. |
Method Summary | |
---|---|
static void |
checkGroupCols(DataTableSpec spec,
List<String> groupCols)
|
static DataTableSpec |
createGroupByTableSpec(DataTableSpec spec,
List<String> groupColNames,
ColumnAggregator[] columnAggregators,
ColumnNamePolicy colNamePolicy)
|
BufferedDataTable |
getBufferedTable()
|
Map<RowKey,Set<RowKey>> |
getHiliteMapping()
the hilite translation Map or null if
the enableHilte flag in the constructor was set to false . |
Map<String,Collection<String>> |
getSkippedGroupsByColName()
Returns a Map with all skipped groups. |
String |
getSkippedGroupsMessage(int maxGroups,
int maxCols)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GroupByTable(ExecutionContext exec, BufferedDataTable inDataTable, List<String> groupByCols, ColumnAggregator[] colAggregators, int maxUniqueValues, boolean sortInMemory, boolean enableHilite, ColumnNamePolicy colNamePolicy) throws CanceledExecutionException
exec
- the ExecutionContext
inDataTable
- the table to aggregategroupByCols
- the name of all columns to group bycolAggregators
- the aggregation columns with the aggregation method
to use in the order the columns should be appear in the result table
numerical columnsmaxUniqueValues
- the maximum number of unique valuessortInMemory
- true
if the table should be sorted in
the memoryenableHilite
- true
if a row key map should be
maintained to enable hilitingcolNamePolicy
- the ColumnNamePolicy
for the
aggregation columns
input table if set to true
CanceledExecutionException
- if the user has canceled the executionpublic GroupByTable(ExecutionContext exec, BufferedDataTable inDataTable, List<String> groupByCols, ColumnAggregator[] colAggregators, int maxUniqueValues, boolean sortInMemory, boolean enableHilite, ColumnNamePolicy colNamePolicy, boolean retainOrder) throws CanceledExecutionException
exec
- the ExecutionContext
inDataTable
- the table to aggregategroupByCols
- the name of all columns to group bycolAggregators
- the aggregation columns with the aggregation method
to use in the order the columns should be appear in the result table
numerical columnsmaxUniqueValues
- the maximum number of unique valuessortInMemory
- true
if the table should be sorted in
the memoryenableHilite
- true
if a row key map should be
maintained to enable hilitingcolNamePolicy
- the ColumnNamePolicy
for the
aggregation columnsretainOrder
- returns the row of the table in the same order as the
input table if set to true
CanceledExecutionException
- if the user has canceled the executionMethod Detail |
---|
public BufferedDataTable getBufferedTable()
BufferedDataTable
public Map<RowKey,Set<RowKey>> getHiliteMapping()
Map
or null
if
the enableHilte flag in the constructor was set to false
.
The key of the Map
is the row key of the new group row and
the corresponding value is the Collection
with all old row
keys which belong to this group.
Map
or null
if
the enableHilte flag in the constructor was set to false
.public Map<String,Collection<String>> getSkippedGroupsByColName()
Map
with all skipped groups. The key of the
Map
is the name of the column and the value is a
Collection
with all skipped groups.
Map
with all skipped groupspublic String getSkippedGroupsMessage(int maxGroups, int maxCols)
maxGroups
- the maximum number of skipped groups to displaymaxCols
- the maximum number of columns to display per group
String
message with the skipped groups per column
or null
if no groups where skippedpublic static final DataTableSpec createGroupByTableSpec(DataTableSpec spec, List<String> groupColNames, ColumnAggregator[] columnAggregators, ColumnNamePolicy colNamePolicy)
spec
- the original DataTableSpec
groupColNames
- the name of all columns to group bycolumnAggregators
- the aggregation columns with the
aggregation method to use in the order the columns should be appear
in the result tablecolNamePolicy
- the ColumnNamePolicy
for the aggregation
columns
DataTableSpec
public static void checkGroupCols(DataTableSpec spec, List<String> groupCols) throws IllegalArgumentException
spec
- the DataTableSpec
to checkgroupCols
- the group by column name List
IllegalArgumentException
- if one of the group by columns doesn't
exists in the given DataTableSpec
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |