Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Intended use of RowProducer?

  1. #1
    Join Date
    May 2006
    Posts
    138

    Default Intended use of RowProducer?

    I'm in progress of making a unit test case for Combination Lookup/Update. I'm working via the API to make a transformation.


    What I did is make a transformation of 1 Combination Update Lookup step, in which I could feed rows with a RowProducer. If I run it it bombs out of course as the lookup step does not have incoming hops.



    So I added a dummytrans step in front of the lookup step. Now the lookup works as it's supposed, I can feed it rows. But the dummy trans now bombs out because of no input row.



    Is there a better way to make such a transformation for testing.



    Also instead of the current RowProducer functionality, wouldn't a new RowProducer step be easier... a step in which you can predefine the rows to be sent to its output and which has no inputs. The current RowProducer way will always have the problem with the incoming hops.



    As current solution I put my rows in a database and am using a Table step connected to the combination lookup/update step to test it.



    Regards,
    Sven

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

    Default RE: Intended use of RowProducer?

    Hi Sven,

    I made TransPreviewFactory.generatePreviewTransformation().
    Perhaps you can generate something similar for generation of test-cases.

    As for the RowProducer, it's fairly new, but was designed in such as way that it adds a new RowSet (to Dummy in your case) so there would in fact be input rows and it would not bomb.

    See: RowProducerTest , it in fact sends rows of data from one Dummy to another.

    Matt

  3. #3
    Join Date
    May 2006
    Posts
    138

    Default RE: Intended use of RowProducer?

    I'll give it a spin.

    The "problem" with RowProducer seems to be that's it's not counted as an input hop. So the getrow() called in the step gets an IndexOutOfBoundsException (if it has no other input hops).

    Sven

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

    Default RE: Intended use of RowProducer?

    I guess you need to to:

    trans.prepareExecution(args);
    RowProducer rp = trans.addRowProducer(Stepname, 0);
    trans.startThreads();

    in stead of just trans.execute()

    HTH,

    Matt

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.