js腳本 kettle怎么使用java腳本?
kettle怎么使用java腳本?完整示例如下:Java代碼字符串firstnamefield string lastnamefield string namefield public Boolean
kettle怎么使用java腳本?
完整示例如下:Java代碼字符串firstnamefield string lastnamefield string namefield public Boolean processrow(stepmetainterface SMI,stepdatainterface SDI)拋出異常{//get input//object[]r=getrow()//輸入為空,直接false//if(r==null){setoutputdone()return false}//出于性能原因,只檢查一次參數(shù)//if(first){firstnamefield=getparameter(“firstnameuField”)lastnameField=getparameter(“LASTNAMEuField”)nameField=getparameter(“NAMEuField”)first=false}//使用createoutputrow()確保輸出數(shù)組足夠大,可以容納任何新字段//object[]outputrow=createoutputrow(R,data.outputRowMeta.size())String firstname=get(字段。在,firstnameField).getString(r)String lastname=get(字段。在,lastnameField).getString(r)//設(shè)置輸出字段中的值//String name=firstname“”lastname獲?。ǚ茽柶?。出去,nameField).setValue(outputRow,name)//putRow將把行發(fā)送到默認(rèn)的輸出躍點(diǎn)。//普特羅(數(shù)據(jù)輸出元數(shù)據(jù),outputRow)返回true}