kettlejava代码过滤_kettle中“Java代码”组件的使⽤⽅法2.选择“Java代码”;
String xuhaotemp;
String chanpintemp;
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi)  throws KettleException{
// First, get a row from the default input hop
Object[] r = getRow();
// If the row object is null, we are done processing.
if (r == null) {
setOutputDone();
return false;
}
if (first){
first = false;
}
// It is always safest to call createOutputRow() to ensure that your output row's Object[] is large
// enough to handle any new fields you are creating in this step.
Object[] outputRow = createOutputRow(r, data.outputRowMeta.size());
String xuhao = get(Fields.In, "Number").getString(r);
String chanpin = get(Fields.In, "NumCode").getString(r);
// Set the value in the output field
String newxuhao = "";
String newchanpin = "";
if (xuhao == null)
{
newxuhao = xuhaotemp;
}
else
{
newxuhao = xuhao;
xuhaotemp = xuhao;
}
if (chanpin == null)
{
newchanpin = chanpintemp;
}
else
output的反义词
{
newchanpin = chanpin;
chanpintemp = chanpin;
}
get(Fields.Out, "newxuhao").setValue(outputRow, newxuhao);
get(Fields.Out, "newchanpin").setValue(outputRow, newchanpin); // putRow will send the row on to the default output hop. putRow(data.outputRowMeta, outputRow);
return true;
}

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。