lookup_Pentaho data Integration

ⅰ亾dé卋堺 提交于 2021-01-29 06:10:30

问题


I have two files (App.csv and Acess.csv)

  1. App.csv has one column called Application
    Application
    App-A

    App-B

  2. Access.csv contains 3 columns (Application, entitlement, userid)

        Application, entitlement, userid
    
        App-A,ent-A,user1
        App-A,ent-B,user1
        App-B,ent-c,user2
        App-B,ent-d,user1
        App-C,ent-c,user2
        App-C,ent-d,user1   
    
  3. I need extract all the App-A and App-B details if it matches Application file column and output should like be below

        App-A,ent-A,user1                                                                                                                                                                                                                         
        App-A,ent-B,user1
        App-B,ent-c,user2
        App-B,ent-d,user1
    
  4. i tried using stream-lookup but it's only giving one row per App instead of all rows belongs to App-A and App-B

any help is appreciated


回答1:


I have prepare a solution for you Here

I used user-define-java-class to compare the value.

  1. RunTrans.ktr: I take app.csv input from here and make data in one row.
  2. ForOnlyLoop.kjb: This is just for passing data to next transformation.
  3. CopmareAndResult.ktr: I take access.csv input from here and compare result, if value match then return row otherwise return nothing.

Please let me know if its ok with you.

Another Solution:- You can get same solution using ETL metadata Injection step from Here

  1. MetaData.ktr:- Take App.csv input and pass value to compare ktr.
  2. Compare.ktr: Take access.csv input and compare value with 'switch/case' step. I have provided switch- case comparison value from MataData.ktr step.


来源:https://stackoverflow.com/questions/64161359/lookup-pentaho-data-integration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!