US and Worldwide: +1 (866) 660-7555
Results 1 to 6 of 6

Thread: Arguments vs. Parameters -

  1. #1
    Join Date
    Nov 2010
    Posts
    23

    Question Arguments vs. Parameters -

    Hello-

    Can someone explain the differences and typical uses of Arguments Vs. Parameters

    Thanks!

    PDI CE build version 4.0.1-stable

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

    Default

    Arguments: Command line arguments passed to pan/kitchen
    Parameters: named parameters.
    Matt Casters, Chief Data Integration
    Pentaho, Open Source Business Intelligence
    http://www.pentaho.org -- mcasters@pentaho.org

    Author of the book Pentaho Kettle Solutions by Wiley. Also available as e-Book and on the Kindle reading applications (iPhone, iPad, Android, Kindle devices, ...)

    Join us on IRC server Freenode.net, channel ##pentaho

  3. #3
    Join Date
    Nov 2010
    Posts
    23

    Question

    Quote Originally Posted by MattCasters View Post
    Arguments: Command line arguments passed to pan/kitchen
    Parameters: named parameters.
    Thanks Matt,

    I tried to run a job using kitchen from the command line. The job has one transformation, the transformation is a simple Flat File to Flat File ETL, it has two parameters one for the input file and the other for the output file. I used the following command line to start the job, it finished successfully but nothing really happens and the logs are not telling me enough

    Code:
    ./kitchen.sh -rep:pilot_repo -user:user -pass:password -level:Debug -dir:/TestWork -job:job_test1001 -param:input_file=/inbound/inf1001/1.dat -param:output_file=inbound/inf1001/1.out.dat
    As you can see above I'm passing the parameter at the command line, I also defined those parameters in the trasnformation and in the job parameter tabs. See attached.

    Below is the log results

    INFO 09-02 17:50:08,220 - Using "/tmp/vfs_cache" as temporary files store.
    INFO 09-02 17:50:10,058 - Kitchen - Kitchen
    INFO 09-02 17:50:10,059 - Kitchen - Kitchen
    INFO 09-02 17:50:10,062 - Kitchen - Kitchen
    DEBUG 09-02 17:50:10,063 - Kitchen - Kitchen
    DEBUG 09-02 17:50:10,108 - Kitchen - Kitchen
    DEBUG 09-02 17:50:10,109 - Kitchen - Kitchen
    INFO 09-02 17:50:10,112 - RepositoriesMeta - Reading repositories XML file: /home/harraz/.kettle/repositories.xml
    DEBUG 09-02 17:50:10,229 - Kitchen - Kitchen
    DEBUG 09-02 17:50:10,230 - Kitchen - Kitchen
    DEBUG 09-02 17:50:10,965 - Kitchen - Kitchen
    DEBUG 09-02 17:50:10,965 - Kitchen - Kitchen
    DEBUG 09-02 17:50:11,580 - Kitchen - Kitchen
    INFO 09-02 17:50:11,606 - job_test1001 - Start of job execution
    INFO 09-02 17:50:11,615 - job_test1001 - Starting entry [FF_2_FF]
    INFO 09-02 17:50:11,624 - FF_2_FF - Loading transformation from repository [FF_2_FF] in directory [/TestWork]
    INFO 09-02 17:50:12,275 - FF_2_FF - Dispatching started for transformation [FF_2_FF]
    INFO 09-02 17:50:12,312 - FF_2_FF - This transformation can be replayed with replay date: 2011/02/09 17:50:12
    INFO 09-02 17:50:12,351 - job_test1001 - Starting entry [DUMMY 2]
    INFO 09-02 17:50:12,353 - job_test1001 - Finished job entry [DUMMY 2] (result=[true])
    INFO 09-02 17:50:12,353 - job_test1001 - Finished job entry [FF_2_FF] (result=[true])
    INFO 09-02 17:50:12,353 - job_test1001 - Job execution finished
    INFO 09-02 17:50:12,362 - Kitchen - Kitchen
    INFO 09-02 17:50:12,363 - Kitchen - Kitchen
    INFO 09-02 17:50:12,363 - Kitchen - Kitchen
    As you can see above, there is no mention of the parameters passed on the command line, and there was no way for me to know if they were expanded properly or not...
    I'm also attaching the job XML file for your reference.

    Thanks for your helping a noob!
    Attached Files Attached Files
    Last edited by harraz; 02-09-2011 at 06:35 PM. Reason: more information

  4. #4
    Join Date
    Mar 2010
    Posts
    159

    Default

    You can use a "Write to log" step in your job to verify that the parameters were picked up properly from command line. Use ctrl-space while in the message portion and you can select parameter to log.

    Apologies - I am too busy to check your job and would need transform also to make sure you are passing things correctly - but:

    If your params are getting into your job OK but not your transform, then you need to check your parameter passing from the job into transform. They should be defined in the transform properties, and you should also specify them in the transform widget used in the job to invoke the transform. There's an option to automatically pass all params to called transform but I know there was once a bug there at least in 3.2.x and it was safer for me to explicitly pass the params into transform or job called.

    Regards,
    Jeremy

  5. #5
    Join Date
    Nov 2010
    Posts
    23

    Default

    Jeremy

    Thanks for the response, I will try those suggestions, I also uploaded the transformation in case you have time to look at it

    Quote Originally Posted by jbeal View Post
    You can use a "Write to log" step in your job to verify that the parameters were picked up properly from command line. Use ctrl-space while in the message portion and you can select parameter to log.

    Apologies - I am too busy to check your job and would need transform also to make sure you are passing things correctly - but:

    If your params are getting into your job OK but not your transform, then you need to check your parameter passing from the job into transform. They should be defined in the transform properties, and you should also specify them in the transform widget used in the job to invoke the transform. There's an option to automatically pass all params to called transform but I know there was once a bug there at least in 3.2.x and it was safer for me to explicitly pass the params into transform or job called.

    Regards,
    Jeremy
    Attached Files Attached Files

  6. #6

    Default

    A parameter is a variable declared in the function or method (depends on the programming language) definition. An argument is an expression that is passed to the function or method in place of a parameter. When a function or method is invoked, all of the parameters of the function or method are created as variables, and the value or reference of the arguments are passed (as value or reference) into the parameters.

    gym.prathap
    java training institute

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •