我正在尝试从我的下方转换中获取Link
步骤中的User Defined Java Class
字段。
以下是我在User Defined Java Class
中编写的代码:
private String link;
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException
{
Object[] r=getRow();
if (r == null) {
setOutputDone();
return false;
}
if (first) {
link = getParameter("Link");
first = false;
}
String linkField = get(Fields.In, link).getString(r);
logBasic("link:" + link);
return true;
}
当我运行上面的代码时,这是我在用户定义的Java类步骤中得到的错误:
2016/06/28 11:26:57 - User Defined Java Class.0 - ERROR (version 5.4.0.1-130, build 1 from 2015-06-14_12-34-55 by buildguy) : Unexpected error
2016/06/28 11:26:57 - User Defined Java Class.0 - ERROR (version 5.4.0.1-130, build 1 from 2015-06-14_12-34-55 by buildguy) : org.pentaho.di.core.exception.KettleStepException:
2016/06/28 11:26:57 - User Defined Java Class.0 - Unable to find In field helper for field name 'null'
2016/06/28 11:26:57 - User Defined Java Class.0 -
2016/06/28 11:26:57 - User Defined Java Class.0 - at org.pentaho.di.trans.steps.userdefinedjavaclass.TransformClassBase.get(TransformClassBase.java:628)
2016/06/28 11:26:57 - User Defined Java Class.0 - at Processor.processRow(Processor.java:15)
2016/06/28 11:26:57 - User Defined Java Class.0 - at org.pentaho.di.trans.steps.userdefinedjavaclass.UserDefinedJavaClass.processRow(UserDefinedJavaClass.java:1018)
2016/06/28 11:26:57 - User Defined Java Class.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2016/06/28 11:26:57 - User Defined Java Class.0 - at java.lang.Thread.run(Thread.java:745)
2016/06/28 11:26:57 - User Defined Java Class.0 - Finished processing (I=0, O=0, R=1, W=0, U=0, E=1)
要确认字段,此处是预览数据的快照,直到Filter rows
步骤:
我哪里错了?