回覆列表
  • 1 # oxxFgg

    完整例子如下:Java程式碼 String firstnameField; String lastnameField; String nameField; public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException { // 獲取輸入 // Object[] r = getRow(); // 輸入為空,直接false // if (r == null) { setOutputDone(); return false; } // 處於效能考慮,parameter只查一次 // if (first) { firstnameField = getParameter("FIRSTNAME_FIELD"); lastnameField = getParameter("LASTNAME_FIELD"); nameField = getParameter("NAME_FIELD"); first=false; } // 用 createOutputRow() 來保證output的陣列夠大,能夠裝下任何新的域 // Object[] outputRow = createOutputRow(r, data.outputRowMeta.size()); String firstname = get(Fields.In, firstnameField).getString(r); String lastname = get(Fields.In, lastnameField).getString(r); // Set the value in the output field // String name = firstname+" "+lastname; get(Fields.Out, nameField).setValue(outputRow, name); // putRow will send the row on to the default output hop. // putRow(data.outputRowMeta, outputRow); return true; }

  • 中秋節和大豐收的關聯?
  • 分析西遊記人物性格?