use of org.pentaho.di.core.exception.KettleRowException in project pentaho-kettle by pentaho.
the class Append method processRow.
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException {
meta = (AppendMeta) smi;
data = (AppendData) sdi;
Object[] input = null;
if (data.processHead) {
input = getRowFrom(data.headRowSet);
if (input == null) {
// Switch to tail processing
data.processHead = false;
data.processTail = true;
} else {
if (data.outputRowMeta == null) {
data.outputRowMeta = data.headRowSet.getRowMeta();
}
}
}
if (data.processTail) {
input = getRowFrom(data.tailRowSet);
if (input == null) {
setOutputDone();
return false;
}
if (data.outputRowMeta == null) {
data.outputRowMeta = data.tailRowSet.getRowMeta();
}
if (data.firstTail) {
data.firstTail = false;
// read the first row of the tail.
try {
checkInputLayoutValid(data.headRowSet.getRowMeta(), data.tailRowSet.getRowMeta());
} catch (KettleRowException e) {
throw new KettleException(BaseMessages.getString(PKG, "Append.Exception.InvalidLayoutDetected"), e);
}
}
}
if (input != null) {
putRow(data.outputRowMeta, input);
}
if (checkFeedback(getLinesRead())) {
if (log.isBasic()) {
logBasic(BaseMessages.getString(PKG, "AppendRows.LineNumber") + getLinesRead());
}
}
return true;
}
Aggregations