Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: How to read Database Lookup?

  1. #1

    Default How to read Database Lookup?

    Hi All,

    I have an input source coming from one database and want to only accept the data that is configured in a master table in other database. To do so i had created a lookup of the master table. Now comes the confusion(Because of using lot of other tools in past), i was hoping to read the lookup table from the Java Script component using some function passing the parameters(Without creating a hop)? not sure how do i do that? if i could...

    Or the only way is to physically join the lookup and Javascript and refer to those values .

    Was searching for quite some time over the net , on implementation of the database lookup. Cdnt find any.

    Iam a new user of this tool, please bear with my ignorance.

    Regards,
    Raju
    Last edited by rajukvg; 10-23-2007 at 05:16 PM.

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    Most of the steps add data to the flow... so you just have a sequence of table input, database lookup and then either javascript or a filter step. By the time the row reaches the javascript or filter step the lookup data will be in the row.

    Regards,
    Sven

  3. #3

    Default

    If i understood your answer correctly, i need to put a hop between the Lookup and Java Script. So the values will be there in the Java script. Doesn’t this look like a join, than that of a lookup? I was using Abinitio ETL tool earlier, the way it is implemented is , once you create a DB lookup, the tool caches the information(mostly in a file i guess). And in the transformations we call the lookup passing the input arguments and what attributes we want out of the lookup for that row. And never link the lookup's to the actual component. Also there was a facility to put all the lookups in one graph and embed this graph in all the transformation where ever it is needed (reusability). That way, i will avoid creating n number of lookups across multiple transformations that will be running in a nightly batch and also this eases the process of cleaning the cache files

    Consider the following scenario. I get details about a country and its performance from one location and have a list of country's that iam interested in from some other location. I create a lookup with the second input set. And now from the input country performance i create a hop to JavaScript component. And a hop from lookup to the Java script component. And then Join the lookup and input using java script? if so is there any difference between Join and lookup?

    If there is any sample that i could look at, that would be great!

    And thanks again for a quick response.

    Regards,
    Raju

  4. #4
    Join Date
    May 2006
    Posts
    4,882

    Default

    Forget how Ab Initio works ... this is just table input with hop to database lookup with hop to javascript. In the samples directory there's not a readily available example as you need a database of course... but try, it's easy , what comes closest is probably the Stream Lookup example under samples.

    Most of the steps in PDI work like this, they read input rows, add data to the rows and output the result.

    Also have a quick look at http://kettle.pentaho.org/tips/?tip=3

    Regards,
    Sven

    P.S. If you're looking up countries use Stream lookup instead of database lookup... there's not that many countries around
    Last edited by sboden; 10-23-2007 at 06:18 PM.

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.