Hitachi Vantara Pentaho Community Forums
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Tutorial: Using command line arguments with Kettle and scheduling

  1. #1
    Join Date
    Aug 2008
    Posts
    563

    Default Tutorial: Using command line arguments with Kettle and scheduling

    All,
    I put together a fairly detailed article on how to use command line arguments with Kettle to make your transformations and jobs more flexible. I also quickly describe scheduling. Please find the article here.
    Best regards,
    Diethard
    ===============
    Visit my Pentaho blog which offers some tutorials mainly on Kettle, Report Designer and Mondrian
    ===============

  2. #2
    Join Date
    Jun 2007
    Posts
    260

    Default

    You've become one of my favourite bloggers. Nicely done.

  3. #3
    Join Date
    Aug 2008
    Posts
    563

    Default

    Thanks a lot for your feedback! Much appreciated!
    Best regards,
    Diethard
    ===============
    Visit my Pentaho blog which offers some tutorials mainly on Kettle, Report Designer and Mondrian
    ===============

  4. #4
    Join Date
    May 2011
    Posts
    3

    Default

    Hi Folks:

    I'm new to Kettle. I am trying to figure out how to pass parameters into Spoon to do what you demonstrate in your example. I'm running under Windows, and I really don't understand the Unix side of things. Can you provide a simple example of how I would launch a Transformation from the command line in Windows? It would be greatly appreciated.

    So far, this seems to be a very flexible program. I eventually want to run it on the Mac, but I have less reliable drivers available in that environment.

  5. #5
    Join Date
    Jun 2007
    Posts
    260

    Default

    lsnover

    The PAN and KITCHEN tools are used to run tranformation and jobs from the command line, irrespective of which OS you are on.

    In its simplest form:
    pan.bat /file:"C:\some\dir\Transformation.ktr"
    will run a transformation, and
    kitchen.bat /file:"C:\some\dir\Job.kjb"
    will run a PDI job,

  6. #6
    Join Date
    May 2011
    Posts
    3

    Default

    Crafter:

    OK, I'm trying to get a handle on this. It seems Pan runs Transformation files, and Kitchen runs job files. So you pass the file path into the batch file. That makes some sense. My question is, I want to pass a variable into my transformation, ie. A set of dates, or a record key, to use in the Where clause of my Input component. I can not figure out how to do that. Also, is there a way to simply launch Spoon with Parameter values to test this type of situation? Thank you for your assistance.

    Sincerely,
    Lee

  7. #7
    Join Date
    Jun 2007
    Posts
    260

    Default

    Lee

    The WIKI has useful information that will get you on your way to mastering PDI.

    Spoon is your designer, which allows you to save and run your transformation jobs, which you can also run with pan and kitchen respectively. So anything you do in spoon, you do using the command line tools as well.

    PDI has a number of useful features regarding variables. You can set variables in you kettle.properties file (or indeed any properties file). use environment variables, and even set variables with differing scope withing your jobs.

    Now I suggest you go back to the tutorial at the first post and see if it makes sense.

  8. #8
    Join Date
    May 2011
    Posts
    3

    Default

    Hi Again Crafter:

    OK, it's starting to make more sense. I see when I actually run my transformation in Spoon, there is a dialog where I can enter arguments, parameters, variables. I was able to specify an argument, covert to a number and by using ? in my query, use the value. That is all fab. I'm a little confused about the difference between Arguments, Parameters and Variables. I attempted to define a variable from my Parameter so I could give it a specific field name, but the step gave me a warning message that said "I could not use the variable in this transformation" due to things happening in parallel. It seems I must define the variable in a job that calls the transformation, which will then allow the variable to be populated before the transformation happens? The tutorial has been a big help, but, I still don't see an example of how I call my Job/Transformation with an argument beyond the file name. That is the part that has me stumped. Making progress. THere's a book available on Kettle I see, do you know if it is good and is it valid for the current 4.x version?

    Thank you again for your help. It's a little daunting.

  9. #9
    Join Date
    Jun 2011
    Posts
    2

    Default

    crafter

    I have tried what you mention in your post but it doesn't work, neither kitchen nor pan. I need to run it in windows xp.
    What I get it's the following error:

    C:\AAC\ext\kettle>Pan.bat /file:"C:\Mapping\casiopea.ktr"
    /level:Basic
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logg
    er
    at org.pentaho.di.core.util.EnvUtil.<clinit>(EnvUtil.java:31)
    at org.pentaho.di.pan.Pan.main(Pan.java:49)
    Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 2 more


    Do you know any solution?

  10. #10
    Join Date
    Jun 2007
    Posts
    260

    Default

    Parryta

    Welcome to the Pentaho community. Please raise your issue in another post rather that hijacking this post which is to announce diddy's tutorial. I'm sure you'll have more luck with an answer if you do that.

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.