import com.java.justtest.beReferToJT;
// 备份原来的代码
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException {
if (first) {
first = false;
/* TODO: Your code here. (Using info fields)
FieldHelper infoField = get(Fields.Info, "info_field_name");
RowSet infoStream = findInfoRowSet("info_stream_tag");
Object[] infoRow = null;
int infoRowCount = 0;
// Read all rows from info step before calling getRow() method, which returns first row from any
// input rowset. As rowMeta for info and input steps varies getRow() can lead to errors.
while((infoRow = getRowFrom(infoStream)) != null){
// do something with info data
infoRowCount++;
}
*/
}
Object[] inputRow = this.getRow();
if (inputRow == null) {
setOutputDone();
return 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(inputRow, data.outputRowMeta.size());
//1 字符串
//String Id = get(Fields.In, “id”).getString(inputRow);
String newMyother = get(Fields.In, “myother”).getString(inputRow);
//2 整形 Integer
Long Id = get(Fields.In, “id”).getInteger(inputRow);
//3 浮点型(double)
//Double Id = get(Fields.In, “id”).getDouble(inputRow);
//处理
//1 id String
//String newId = String.valueOf(Double.parseDouble(Id)+3);
// 2 Integer
String newId = String.valueOf(Id+3);
//3 double
//String newId = String.valueOf(Id+3);
get(Fields.Out, “newid”).setValue(outputRow, newId);
get(Fields.Out, “newmyother”).setValue(outputRow, newMyother);
//get(Fields.Out, “id”).setValue(r, (id + 1));
//String id = get(Fields.In, “id”).getString®;
// Send the row on to the next step.
putRow(data.outputRowMeta, outputRow);
return true;
}