Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Plugin Development Simple Step

  1. #1
    Join Date
    Mar 2011
    Posts
    140

    Lightbulb Plugin Development Simple Step

    Hello everyone,

    I was trying to develop a Kettle plugin to get familiar with the Kettle code.

    I decided to create a simple step that would overwrite all values of the specified columns with a certain text. Now I was able to get the value of a certain colomn with the method: getOutputRowMeta().getString(row, column, null); However, I don't see like a setString method, so how would I be able to overwrite that value ?


    Thanks in Advance !

  2. #2
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    The input row that you get from a getRow() command, is Object[]

    So simply do

    Code:
    Object[] row = getRow();
    Object[] outputRow = RowDataUtil.createResizedCopy(row, newlength);
    ...
    outputRow[index] = "Your String";
    ...
    putRow(outputRowMeta, outputRow);
    ...
    That's all there is to it. Just make sure that whatever data type you put in row[] matches outputRowMeta specified in putRow.

  3. #3
    Join Date
    Mar 2011
    Posts
    140

    Default

    Hey Matt,

    Yea, that's the way I'm doing it now, without the
    RowDataUtil.createResizedCopy(row, newlength)
    though. I'm using the row directly, so I'll look into that.


    Thanks for the help !



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.