use of org.knime.core.node.streamable.BufferedDataTableRowOutput in project knime-core by knime.
the class ExtractMissingValueCauseNodeModel method execute.
@Override
protected BufferedDataTable[] execute(final BufferedDataTable[] inObjects, final ExecutionContext exec) throws Exception {
final ColumnRearranger columnRearranger = createColumnRearranger(inObjects[0].getDataTableSpec());
if (!m_isFiltered.getBooleanValue()) {
final BufferedDataTable out = exec.createColumnRearrangeTable(inObjects[0], columnRearranger, exec);
return new BufferedDataTable[] { out };
} else {
exec.setProgress(0);
final BufferedDataTableRowOutput out = new BufferedDataTableRowOutput(exec.createDataContainer(columnRearranger.createSpec()));
execute(new DataTableRowInput(inObjects[0]), out, exec, inObjects[0].size());
return new BufferedDataTable[] { out.getDataTable() };
}
}
use of org.knime.core.node.streamable.BufferedDataTableRowOutput in project knime-core by knime.
the class NumericOutliersReviser method treatOutliers.
/**
* Removes/Retains all rows from the input table that contain outliers. Additionally, the outlier and group related
* counts, and the new domains are calculated.
*
* @param exec the execution context
* @param in the input data table
* @param outlierModel the model storing the permitted intervals
* @return returns the data table whose outliers have been treated
* @throws Exception any exception to indicate an error, cancelation.
*/
public BufferedDataTable treatOutliers(final ExecutionContext exec, final BufferedDataTable in, final NumericOutliersModel outlierModel) throws Exception {
final BufferedDataTableRowOutput out = new BufferedDataTableRowOutput(exec.createDataContainer(getOutTableSpec(in.getDataTableSpec())));
// treat the outliers
treatOutliers(exec, new DataTableRowInput(in), out, outlierModel, in.size(), false);
// store the result
final BufferedDataTable outTable;
// update the domain if necessary. This cannot be done if we are in streaming mode
if (updateDomain()) {
outTable = m_domainUpdater.updateDomain(exec, out.getDataTable());
m_domainUpdater = null;
} else {
outTable = out.getDataTable();
}
// set empty table message only if not both tables are empty
if (outTable.size() == 0 && m_summaryTable.size() > 0) {
warnListeners(EMPTY_TABLE_WARNING);
}
// return the table
return outTable;
}
use of org.knime.core.node.streamable.BufferedDataTableRowOutput in project knime-core by knime.
the class DateTimeDifferenceNodeModel method execute.
/**
* {@inheritDoc}
*/
@Override
protected BufferedDataTable[] execute(final BufferedDataTable[] inData, final ExecutionContext exec) throws Exception {
if (m_modusSelectModel.getStringValue().equals(ModusOptions.UsePreviousRow.name())) {
final BufferedDataTableRowOutput out = new BufferedDataTableRowOutput(exec.createDataContainer(new DataTableSpecCreator(inData[0].getDataTableSpec()).addColumns(createColumnSpec(inData[0].getDataTableSpec())).createSpec()));
execute(new DataTableRowInput(inData[0]), out, exec, inData[0].size());
return new BufferedDataTable[] { out.getDataTable() };
} else {
final ColumnRearranger r = createColumnRearranger(inData[0].getDataTableSpec());
final BufferedDataTable out = exec.createColumnRearrangeTable(inData[0], r, exec);
return new BufferedDataTable[] { out };
}
}
Aggregations