Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Newb question on how to do a Lookup.

  1. #1
    Join Date
    Jun 2013
    Posts
    1

    Default Newb question on how to do a Lookup.

    I'm just starting with Kettle. I've done the Hello World tutorial and am now attempting a shallow step into the Kettle pool.

    The end goal is to load a customer provided delimited file into a relational database.

    Name:  CreateAcctLrf.png
Views: 37
Size:  13.6 KB

    Here some pretend data.

    Customer Input File (parseCfAcct)
    ACCT_ALIAS,ACCT_TYP,ACCT_STAT,EMAIL
    mr_monkey,MONKEY_TRAINER,INACTIVE,mrmonkey@test.com
    mrs_cat,CAT_TRAINER,INACTIVE,mrscat@test.com

    Output of qryCdGrpEntries
    CD_GRP_ENT_ID CD_GRP_ALIAS CD_GRP_ENT_ALIAS
    3009 ACCT_STAT ACTIVE
    3010 ACCT_STAT INACTIVE
    3011 ACCT_STAT TERMINATED
    3008 ACCT_TYP CAT_TRAINER
    3005 ACCT_TYP DOG_TRAINER
    3006 ACCT_TYP HORSE_TRAINER
    3007 ACCT_TYP MONKEY_TRAINER

    Expected Ouput of crtAcctLrf
    ACCT_ALIAS,ACCT_TYP,ACCT_STAT,EMAIL
    mr_monkey,3007,3010,mrmonkey@test.com
    mrs_cat,3008,3010,mrscat@test.com

    qryCdGrpEntries and parseCfAcct works just fine. What I'm having less success with is figuring out how to look up the ACCT_STAT and ACCT_TYP in the lookup stream and replace the string value of the composite key (CD_GRP_ALIAS, CD_GRP_ENT_ALIAS) with the PK integer value.

    The Stream Lookup sounded like a good place to start. I wanted to load the CdGrpEntries into memory because they are rather static and I don't want to hit the database everytime I need to do a lookup. Am I using the correct type of lookup for this? Although i've read a bunch of other threads and googled this, I haven't seen anyone addressing the same type of problem. I haven't seen anything that will allow me to examine a given value in a field and do a lookup from another file for it. Which makes me think I'm using the wrong tool (Stream lookup vs ?).

    Thanks

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Stream Lookup is fine - it needs two input hops and one output hop, though.
    Attached Files Attached Files
    So long, and thanks for all the fish.

Tags for this Thread

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.