Hitachi Vantara Pentaho Community Forums
Results 1 to 9 of 9

Thread: database lookup using a variable for the lookup schema

  1. #1
    Join Date
    Dec 2007
    Posts
    7

    Post database lookup using a variable for the lookup schema

    In regards to the database lookup using a variable for the lookup schema. I do have the variable set and the transformation runs correctly, I seems not to resolve itself when any components in the transformation are referenced. It doesn't matter if it is the default schema my id is associated with, or a schema I have access rights to.


    If you put a literal into the target schema field, it will resolve correctly.

    Thanks,

    Bob

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

    Default

    It's not really clear to me what you mean here. Variable replacement is supported and active for the schema-name parameter in the database lookup step.

    Matt

  3. #3
    Join Date
    Dec 2007
    Posts
    7

    Default

    Matt:

    I've attached a series of screen shots which explain the error, they are numbered in sequence. The error only occurs in the graphical development environment.

    1. This is a simple mapping, uses a flat file as input, does a lookup on a value, dropping all rows that don't pass the lookup.

    2. Database lookup is correct; target schema variable ${target_schema} has a value of FMDR

    3. Clicking on the filter component after the database lookup results in the error: Unable to open dialog for this step.

    Error clicking on select values: Failed to execute runnable (java.lang.NullPointerException).

    This problem is only manifested when you are in the graphical design environment, the transformation will work perfectly fine if you run it. However, if you need to maintain the graph, you have to go and remove the variable from all the target schema fields in the database lookups.


    Thanks,

    Bob
    Attached Files Attached Files

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

    Default

    How did you define ${target_schema}?
    If you use the Edit / Set environment variables menu, does the problem go away?

    Matt

  5. #5
    Join Date
    Dec 2007
    Posts
    7

    Default

    Matt:

    ${target_schema} is set as an environment variable. I have it hard coded in the kettle.properties file.

    The variable is resolved correctly if you run the transformation from the GDE or run it via a job.


    Bob

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

    Default

    Thanks Bob!

  7. #7
    Join Date
    Oct 2006
    Posts
    22

    Default

    Hi,

    Im having the same problem, but in my case, it doesnt work even from the job, i mean, if i hardcode it in the inser/update it works, but with the variable, not.

    Greetings from spain!

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

    Default

    You can't use variables in the same transformation where you defined them.

    Greetings from snowwhite Belgium
    Sven

  9. #9

    Default

    Hi,

    I am experiencing, this problem that with the Kettle - Spoon version 3.2.0, that the database lookup step, is not replacing the variable for the lookup schema.
    In the Transformation I am using the same variable in a Table input step, and there it is resolved correctly.

    According to the jira: http://jira.pentaho.com/browse/PDI-2223 the problem was resolved in 3.1.

    In the current Kettle 4 version the problem is probably not there anymore, but I am currently stuck with 3.2.
    Is there anything I am doing wrong, or is there a workaround? Or is still a know issue with 3.2.

    I will use a Stream Lookup step as a workaround now, as in this case I am able to.

    Thanks for any input,
    Thorsten

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.