Hitachi Vantara Pentaho Community Forums
Results 1 to 10 of 10

Thread: Setting environment Variables

  1. #1
    Join Date
    Sep 2005
    Posts
    1,403

    Default Setting environment Variables

    How do I read a value from the database (by supplying a value to the sql where clause) and set it as an environment variable for the JVM ?

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

    Default RE: Setting environment Variables

    Well, you use a table input step and send one (1) row to the "Set Variables" step.
    You need to select the "JVM" scope in that last step.

    (2.3.0 only)

    Matt

  3. #3
    Join Date
    Sep 2005
    Posts
    1,403

    Default RE: Setting environment Variables

    With a table input step, its not possible to pass in a custom value to the where clause. The value passed on to the where clause changes for each run.

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

    Default RE: Setting environment Variables

    Yes it is possible, RTFM: spoon-2.2.pdf, see the chapter on the "Table Input" step.

    Matt

  5. #5
    Join Date
    Sep 2005
    Posts
    1,403

    Default RE: Setting environment Variables

    Matt,

    In the context of the threads above ...

    Do you have to use the '?' placeholder or can you use the variable reference syntax in the Where clause to reference the variable set set with "JVM" scope? (2.3.0)

    Thanks

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

    Default RE: Setting environment Variables

    You have to use the ? placeholder.
    Just allowing ${VAR} would probably break compatibilty with prior releases, we need to add a flag for that.
    Two words: feature request!

    Matt

  7. #7
    Join Date
    Sep 2005
    Posts
    1,403

    Default RE: Setting environment Variables

    Matt,

    Thanks for the reply.

    I have put in Change Request - [# 2505]

    I hope that is the correct format for an Enhancement Request.

    Thanks

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

    Default RE: Setting environment Variables

    Well AC, I implemented it earlier today.
    Grab a new kettle.jar and try out the goodies.
    I'll close the feature request next week.

    Matt

  9. #9
    Join Date
    Apr 2014
    Posts
    2

    Default

    Hey

    I'm having an sql script node which loads my csv file onto hive via hdfs,
    below is the sql script.

    use database;
    truncate table abc;
    load data inpath '${DestinationLocation}' into table abc ;

    the variable value being:
    ${DestinationLocation}= /user/dev/user1/


    it throws the following error:
    Query returned non-zero code: 40000, cause: FAILED: SemanticException Line 1:17 Invalid path ''${DestinationLocation}'': No files matching path maprfs:/user/dev/$%7BDestinationLocation%7D

    can anyone please tell any solution to this problem?

  10. #10
    Join Date
    Apr 2008
    Posts
    4,690

    Default

    Please do not Hijack threads.

    This thread has nothing to do with your request.
    Please start a new thread, and remember to include which version of PDI you are using, which type & version of Hadoop you are using.
    Last edited by gutlez; 04-10-2014 at 12:09 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.