David Pendry
David Pendry

Reputation: 1

Pentaho Kettle Data Integration Parent Child Solution required

I have a source table (from a MS DB) that contains a field "ParentID", which references the PK of "ID"

The target Postgres table is filled (new "ID" PK inserted from sequence) and the "ParentID" is set to null. The stream has a the new PK inserted within it.

So now at this stage i have a valid stream of

"ID"  "ParentID"  "NewTargetID" 
100   NULL        1
101   100         2

How do I do a "Stream Lookup" (or maybe something else) and lookup the values to create a new stream field to give me a new field of "NewParentID"

"ID"  "ParentID"  "NewTargetID"  "NewParentID"
100   NULL        1              NULL -< (How do i generate this ?)
101   100         2              1 -< (How do i generate this ?)

Thanks

David

Upvotes: 0

Views: 1238

Answers (2)

FremenFreedom
FremenFreedom

Reputation: 519

If I understand your use case correctly, you can use the "Add sequence" step for this. It would add a new field to the stream.

Here's the doc: http://wiki.pentaho.com/display/EAI/Add+sequence

Upvotes: 0

mattyb
mattyb

Reputation: 12103

David,

As I'm a new member of StackOverflow I can't post images, so I posted a solution on my blog here:

http://funpdi.blogspot.com/2012/09/parent-child-lookup.html

I also put this link on your Pentaho Forum post, my reply is waiting for approval by the moderator.

Upvotes: 2

Related Questions