Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: Parent Child Relationship with 2 Output Steps

  1. #1
    Join Date
    Apr 2007
    Posts
    27

    Default Parent Child Relationship with 2 Output Steps

    I am trying to update a parent child relationship in a transformation. I have 2 seperate output steps to insert into the parent and child data. Currently these are branched where one branch goes to the parent table output and the other branch goes to the child table output.

    input
    / \
    / \
    Parent Child


    This of course fails because if the child get's inserted before the parent a constraint violation is triggered.


    What would be the correct way to do this?

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

    Default

    Put the output steps in sequence (PDI v3.2) and make the transformation transactional.

  3. #3
    Join Date
    Apr 2007
    Posts
    27

    Default

    Sorry, I guess I should have pointed out that I am filtering the data to the different table output's

    If i put them in sequence I will loose columns that were filtered out in a select from the first table output

  4. #4
    Join Date
    Apr 2007
    Posts
    27

    Default

    My situation looks more like this. My first diagram was incorrect.
    Code:
                        INPUT
                       /        \
               SELECT     SELECT
               /                        \
      PARENT OUTPUT       CHILD OUTPUT
    So the SELECT statements are removing some fields and because of this if I put them in sequence it would not work. I would lose the fields I need to output in this second scenario.

    Code:
                INPUT
                  |      
              SELECT   
                  |                       
        PARENT OUTPUT    
                  |
              SELECT
                  |
         CHILD OUTPUT

  5. #5
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    Use a Job?

    Update the Parent and then in a separate transform, update the children...
    That's not Transactional, but it will meet the constraint.

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

    Default

    No you won't lose columns since version 3.2 allows you to specify the columns to write.

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

    Default

    That would work indeed.

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.