Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Some questions about Java Plugin development for Kettle

  1. #1
    danielh83 Guest

    Default Some questions about Java Plugin development for Kettle

    Hi,

    i am absolutely new to java plugin development for kettle. I have to
    develop a plugin which transform names into phonetic codes. Within the
    plugin you can choose between three algorithm. Therefore I will get
    the row values (name strings) transform them and create for every
    algorithm an new column. Now come my quite basic questions:
    1. How can I get the values out of the row? I found an example here
    (http://type-exit.org/adventures-with...0/10/the-user-
    defined-java-class-step/) under Simple Transformation step, but they
    use a data.get() - method (in main Step class) but I can find/use such
    a method in my class. This is the code snipet I probably should use:
    // Get the value from an input field
    String test_value = get(Fields.In, "testfield").getString(r);

    2. How can I create a new Column with my transformed phonetic codes to
    the output field.

    I am aware that these are really basic questions, but as I mentioned
    its my first contact with Pentaho Data Integration aka Kettle - Plugin
    development.

    Kind regards

    Daniel

    --
    You received this message because you are subscribed to the Google Groups "kettle-developers" group.
    To post to this group, send email to kettle-developers (AT) googlegroups (DOT) com.
    To unsubscribe from this group, send email to kettle-developers+unsubscribe (AT) g...oups (DOT) com.
    For more options, visit this group at http://groups.google.com/group/kettle-developers?hl=en.

  2. #2
    curtis.j.boyden@gmail.com Guest

    Default Re: Some questions about Java Plugin development for Kettle

    Have you checked out the Calculator step (in Transform category)? If offers
    SoundEx and RefinedSoundEx, as well as several "distance between string"
    and a "similitude" between strings.
    None of this sound junk means much to me, but you might be able to just add
    your algorithms in there and submit a patch back for insertion into Kettle
    core.

    HTH,
    -Curtis

    On May 19, 2011 7:51am, danielh83 <danielhoyer (AT) freenet (DOT) de> wrote:
    > Hi,




    > i am absolutely new to java plugin development for kettle. I have to


    > develop a plugin which transform names into phonetic codes. Within the


    > plugin you can choose between three algorithm. Therefore I will get


    > the row values (name strings) transform them and create for every


    > algorithm an new column. Now come my quite basic questions:


    > 1. How can I get the values out of the row? I found an example here


    > ( defined-java-class-step/"
    > target="_blank">http://type-exit.org/adventures-with...0/10/the-user-


    > defined-java-class-step/) under Simple Transformation step, but they


    > use a data.get() - method (in main Step class) but I can find/use such


    > a method in my class. This is the code snipet I probably should use:


    > // Get the value from an input field


    > String test_value = get(Fields.In, "testfield").getString(r);




    > 2. How can I create a new Column with my transformed phonetic codes to


    > the output field.




    > I am aware that these are really basic questions, but as I mentioned


    > its my first contact with Pentaho Data Integration aka Kettle - Plugin


    > development.




    > Kind regards




    > Daniel




    > --


    > You received this message because you are subscribed to the Google
    > Groups "kettle-developers" group.


    > To post to this group, send email to kettle-developers (AT) googlegroups (DOT) com.


    > To unsubscribe from this group, send email to
    > kettle-developers+unsubscribe (AT) g...oups (DOT) com.


    > For more options, visit this group at
    > http://groups.google.com/group/kettle-developers?hl=en.





    --
    You received this message because you are subscribed to the Google Groups "kettle-developers" group.
    To post to this group, send email to kettle-developers (AT) googlegroups (DOT) com.
    To unsubscribe from this group, send email to kettle-developers+unsubscribe (AT) g...oups (DOT) com.
    For more options, visit this group at http://groups.google.com/group/kettle-developers?hl=en.

  3. #3
    Matt Casters Guest

    Default Re: Some questions about Java Plugin development for Kettle

    Check out the Fuzzy match step, it has more options.

    Op 19-mei-2011 15:57 schreef <curtis.j.boyden (AT) gmail (DOT) com>:

    Have you checked out the Calculator step (in Transform category)? If offers
    SoundEx and RefinedSoundEx, as well as several "distance between string" and
    a "similitude" between strings.
    None of this sound junk means much to me, but you might be able to just add
    your algorithms in there and submit a patch back for insertion into Kettle
    core.

    HTH,
    -Curtis



    On May 19, 2011 7:51am, danielh83 <danielhoyer (AT) freenet (DOT) de> wrote:
    > Hi,
    >
    >
    >
    > i am absolutely...
    > ( defined-java-class-step/" target="_blank">

    http://type-exit.org/adventures-with...0/10/the-user-


    >
    > defined-java-class-step/) under Simple Transformation step, but they
    >
    > use a data.get() - m...


    --
    You received this message because you are subscribed to the Google Groups "kettle-developers" group.
    To post to this group, send email to kettle-developers (AT) googlegroups (DOT) com.
    To unsubscribe from this group, send email to kettle-developers+unsubscribe (AT) g...oups (DOT) com.
    For more options, visit this group at http://groups.google.com/group/kettle-developers?hl=en.

  4. #4
    danielh83 Guest

    Default Re: Some questions about Java Plugin development for Kettle

    Thanks guys for your hint to the common transformation steps. I know
    there are already exist transformation steps, but I have to develop my
    own java plugin with at least three phonetic algorithm. Therefor I am
    not allowed to use the standard transformations.

    Any further suggestions for my problem? I just want to know how I can
    read the values from the input Rows and how I can create new columns
    with generated phonetic codes.

    Kind regards
    Daniel

    On 19 Mai, 16:10, Matt Casters <mcast... (AT) pentaho (DOT) org> wrote:
    > Check out the Fuzzy match step, it has more options.
    >
    > Op 19-mei-2011 15:57 schreef <curtis.j.boy... (AT) gmail (DOT) com>:
    >
    > Have you checked out the Calculator step (in Transform category)? If offers
    > SoundEx and RefinedSoundEx, as well as several "distance between string" and
    > a "similitude" between strings.
    > None of this sound junk means much to me, but you might be able to just add
    > your algorithms in there and submit a patch back for insertion into Kettle
    > core.
    >
    > HTH,
    > -Curtis
    >
    > On May 19, 2011 7:51am, danielh83 <danielho... (AT) freenet (DOT) de> wrote:> Hi,
    >
    > > i am absolutely...
    > > ( defined-java-class-step/" target="_blank">

    >
    > http://type-exit.org/adventures-with...0/10/the-user-
    >
    >
    >
    >
    >
    >
    >
    >
    >
    > > defined-java-class-step/) under Simple Transformation step, but they

    >
    > > use a data.get() - m...


    --
    You received this message because you are subscribed to the Google Groups "kettle-developers" group.
    To post to this group, send email to kettle-developers (AT) googlegroups (DOT) com.
    To unsubscribe from this group, send email to kettle-developers+unsubscribe (AT) g...oups (DOT) com.
    For more options, visit this group at http://groups.google.com/group/kettle-developers?hl=en.

  5. #5
    curtis.j.boyden@gmail.com Guest

    Default Re: Re: Some questions about Java Plugin development for Kettle

    Hi Daniel,

    In that case, I recommend checking out the DummyPlugin example:

    http://wiki.pentaho.com/display/EAI/...+3+plugin+page

    The code is pretty helpful.


    Basically, every Transformation Step has 4 classes:
    - Plugin: Main processing component
    - Meta: Configuration information (How the step was configured in spoon)
    - Data: Runtime data (Each running instance of the thread can keep track of
    state here)
    - Dialog: Configuration dialog (Used in Spoon)

    How to read in rows:
    The Plugin is the "core" of the step and contains the all important
    processRow(StepMetaInterface smi, StepDataInterface sdi) method.
    This method is executed continuously and the getRow() method is invoked to
    pull data from the input stream for processing. getInputRowMeta() can be
    used to fetch information about the structure of the Object array returned
    by getRow(); (size, type, etc...)
    NOTE: Do not go by the size of the Object[] returned by getRow(), it is
    allocated in chunks. Get the field count for the incoming row from
    getInputRowMeta().

    How to create new fields for output:
    In the processRow(...) method you invoke putRow(meta, row) to send a row to
    the output stream (onto the next step). You determine what the meta is, a
    simple way to accomplish field addition is to copy the input row meta and
    add your output field meta to it. Then use that as the outputMeta.
    Checkout
    http://source.pentaho.org/svnkettler...Generator.java
    for an example.
    NOTE: RowGenerateMeta.getFields(...) is used to tell the UI what the
    outputMeta will be at build time. This is important to do.


    Loading and Saving of step are accomplished in the StepMeta with the
    following four methods:
    Repository:
    - readRep(...)
    - saveRep(...)
    File:
    - loadXml(...)
    - getXml(...)


    There is a new SDK section that you can add to if you want as well:
    http://wiki.pentaho.com/display/EAI/...in+Development

    Other confusing links:
    http://wiki.pentaho.com/display/COM/PDI+Plugin+Loading
    http://wiki.pentaho.com/display/EAI/...ration+Plug-In

    Hope this helps,
    -Curtis

    On May 20, 2011 7:49am, danielh83 <danielhoyer (AT) freenet (DOT) de> wrote:
    > Thanks guys for your hint to the common transformation steps. I know


    > there are already exist transformation steps, but I have to develop my


    > own java plugin with at least three phonetic algorithm. Therefor I am


    > not allowed to use the standard transformations.




    > Any further suggestions for my problem? I just want to know how I can


    > read the values from the input Rows and how I can create new columns


    > with generated phonetic codes.




    > Kind regards


    > Daniel




    > On 19 Mai, 16:10, Matt Casters mcast... (AT) pentaho (DOT) org> wrote:


    > > Check out the Fuzzy match step, it has more options.


    > >


    > > Op 19-mei-2011 15:57 schreef curtis.j.boy... (AT) gmail (DOT) com>:


    > >


    > > Have you checked out the Calculator step (in Transform category)? If

    > offers


    > > SoundEx and RefinedSoundEx, as well as several "distance between

    > string" and


    > > a "similitude" between strings.


    > > None of this sound junk means much to me, but you might be able to just

    > add


    > > your algorithms in there and submit a patch back for insertion into

    > Kettle


    > > core.


    > >


    > > HTH,


    > > -Curtis


    > >


    > > On May 19, 2011 7:51am, danielh83 danielho... (AT) freenet (DOT) de> wrote:> Hi,


    > >


    > > > i am absolutely...


    > > > ( defined-java-class-step/" target="_blank">


    > >


    > > http://type-exit.org/adventures-with...0/10/the-user-


    > >


    > >


    > >


    > >


    > >


    > >


    > >


    > >


    > >


    > > > defined-java-class-step/) under Simple Transformation step, but they


    > >


    > > > use a data.get() - m...




    > --


    > You received this message because you are subscribed to the Google
    > Groups "kettle-developers" group.


    > To post to this group, send email to kettle-developers (AT) googlegroups (DOT) com.


    > To unsubscribe from this group, send email to
    > kettle-developers+unsubscribe (AT) g...oups (DOT) com.


    > For more options, visit this group at
    > http://groups.google.com/group/kettle-developers?hl=en.





    --
    You received this message because you are subscribed to the Google Groups "kettle-developers" group.
    To post to this group, send email to kettle-developers (AT) googlegroups (DOT) com.
    To unsubscribe from this group, send email to kettle-developers+unsubscribe (AT) g...oups (DOT) com.
    For more options, visit this group at http://groups.google.com/group/kettle-developers?hl=en.

  6. #6
    Matt Casters Guest

    Default Re: Some questions about Java Plugin development for Kettle

    One more comment: you don't need to create a plugin to embed your own
    algorithms. You can also use the "User defined Java class" step:

    http://wiki.pentaho.com/display/EAI/...ned+Java+Class

    Good luck,
    Matt


    2011/5/20 danielh83 <danielhoyer (AT) freenet (DOT) de>

    > Thanks guys for your hint to the common transformation steps. I know
    > there are already exist transformation steps, but I have to develop my
    > own java plugin with at least three phonetic algorithm. Therefor I am
    > not allowed to use the standard transformations.
    >
    > Any further suggestions for my problem? I just want to know how I can
    > read the values from the input Rows and how I can create new columns
    > with generated phonetic codes.
    >
    > Kind regards
    > Daniel
    >
    > On 19 Mai, 16:10, Matt Casters <mcast... (AT) pentaho (DOT) org> wrote:
    > > Check out the Fuzzy match step, it has more options.
    > >
    > > Op 19-mei-2011 15:57 schreef <curtis.j.boy... (AT) gmail (DOT) com>:
    > >
    > > Have you checked out the Calculator step (in Transform category)? If

    > offers
    > > SoundEx and RefinedSoundEx, as well as several "distance between string"

    > and
    > > a "similitude" between strings.
    > > None of this sound junk means much to me, but you might be able to just

    > add
    > > your algorithms in there and submit a patch back for insertion into

    > Kettle
    > > core.
    > >
    > > HTH,
    > > -Curtis
    > >
    > > On May 19, 2011 7:51am, danielh83 <danielho... (AT) freenet (DOT) de> wrote:> Hi,
    > >
    > > > i am absolutely...
    > > > ( defined-java-class-step/" target="_blank">

    > >
    > > http://type-exit.org/adventures-with...0/10/the-user-
    > >
    > >
    > >
    > >
    > >
    > >
    > >
    > >
    > >
    > > > defined-java-class-step/) under Simple Transformation step, but they

    > >
    > > > use a data.get() - m...

    >
    > --
    > You received this message because you are subscribed to the Google Groups
    > "kettle-developers" group.
    > To post to this group, send email to kettle-developers (AT) googlegroups (DOT) com.
    > To unsubscribe from this group, send email to
    > kettle-developers+unsubscribe (AT) g...oups (DOT) com.
    > For more options, visit this group at
    > http://groups.google.com/group/kettle-developers?hl=en.
    >
    >



    --
    Matt Casters <mcasters (AT) pentaho (DOT) org>
    Chief Data Integration, Kettle founder, Author of Pentaho Kettle
    Solutions<http://www.amazon.com/Pentaho-Kettle-Solutions-Building-Integration/dp/0470635177>
    (Wiley <http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0470635177.html>)
    Fonteinstraat 70, 9400 OKEGEM - Belgium - Cell : +32 486 97 29 37
    Pentaho : The Commercial Open Source Alternative for Business Intelligence

    --
    You received this message because you are subscribed to the Google Groups "kettle-developers" group.
    To post to this group, send email to kettle-developers (AT) googlegroups (DOT) com.
    To unsubscribe from this group, send email to kettle-developers+unsubscribe (AT) g...oups (DOT) com.
    For more options, visit this group at http://groups.google.com/group/kettle-developers?hl=en.

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.