US and Worldwide: +1 (866) 660-7555
+ Reply to Thread
Results 1 to 5 of 5

Thread: Command line parameters

  1. #1
    Join Date
    Sep 2008
    Posts
    15

    Question Command line parameters

    Hi,

    I have been using Kettle for a week now and I like this tool so far.

    However, I am having trouble trying to get command line parameters to work correctly.

    Basically, I want to be able to pass 2 dates as parameters to my transformation. After reading a few threads on this forum, I was able to resolve the errors like 'index column not found' etc, successfully.

    Although, I do not get any errors now, I don't see any output either. My transformation runs successfully and I am able to see the following in my log file -

    2008/10/26 22:56:30:831 EDT [INFO] DefaultFileReplicator - Using "/tmp/vfs_cache" as temporary files store.
    Unable to find kettle engine jar file to set build date. (ignored)
    INFO 26-10 22:56:31,180 - Final - Dispatching started for transformation [Final]
    INFO 26-10 22:56:31,188 - Final - This transformation can be replayed with replay date: 2008/10/26 22:56:31
    INFO 26-10 22:56:31,487 - Get System Info.0 - Finished processing (I=0, O=0, R=1, W=1, U=1, E=0)
    INFO 26-10 22:56:33,851 - contri.0 - Finished reading query, closing connection.
    INFO 26-10 22:56:33,856 - contri.0 - Finished processing (I=0, O=0, R=1, W=0, U=0, E=0)
    INFO 26-10 22:56:33,861 - Pan - Finished!
    INFO 26-10 22:56:33,861 - Pan - Start=2008/10/26 22:56:30.898, Stop=2008/10/26 22:56:33.861
    INFO 26-10 22:56:33,861 - Pan - Processing ended after 2 seconds.
    INFO 26-10 22:56:33,861 - Final -
    INFO 26-10 22:56:33,862 - Final - Process Get System Info'.0 ended successfully, processed 1 lines. ( 0 lines/s)
    INFO 26-10 22:56:33,862 - Final - Process contri'.0 ended successfully, processed 1 lines. ( 0 lines/s)
    INFO 26-10 22:56:33,862 - Final - Process output'.0 ended successfully, processed 0 lines. ( 0 lines/s)


    The query I am using in my table input step, does return rows if run in Oracle, but there's nothing being written to the output .csv file that I'm writing to in my transformation...and I cannot figure out why!

    Below is the query in my step -
    SELECT * FROM
    CON
    WHERE LAST_MOD_DATE >= ?
    AND LAST_MOD_DATE < ?

    and this is how I'm running the .ktr file -

    nohup pan.sh -file /home/sramsetty/Final.ktr "05-Aug-2008" "02-Oct-2008" -norep > final.log 2>&1 &

    I am attaching my transformation file here and will greatly appreciate any help I can get on this. We have a really tight schedule for our development and again, any help is highly appreciated.

    Thanks,
    Sowj.
    Attached Files

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

    Default

    Can't test it right now... but I would put the -norep in front of the "real" arguments. And use "execute for each row" in table input.

    Then set logging to the highest level and run the transformation in spoon. On the start dialog in the left-lower hand box you can put the command line arguments in.

    Regards,
    Sven

  3. #3
    Join Date
    Sep 2008
    Posts
    15

    Thumbs up

    Thanks a lot for the quick response Sven. Works with the suggestions you made!

    Thanks a ton,
    Sowj.

  4. #4
    Join Date
    Jan 2008
    Posts
    3

    Default

    2008/11/07 17:42:17 - norman - From step: Modified Java Script Value, looking at 0 prev. steps.
    2008/11/07 17:42:17 - norman - From step: Modified Java Script Value, looking at 0 prev. steps.
    2008/11/07 17:42:37 - org.pentaho.di.ui.trans.steps.textfileoutput.TextF ileOutputDialog - getting fields info...
    2008/11/07 17:42:42 - Spoon - Save to file or repository...
    2008/11/07 17:42:42 - User preferences - Save properties for Spoon...
    2008/11/07 17:42:42 - Spoon - File written to [C:\Documents and Settings\rcornejo\Escritorio\norman.ktr]
    2008/11/07 17:42:42 - SharedObjects - Reading the shared objects file [file:///C:/Documents and Settings/rcornejo/.kettle/shared.xml]
    2008/11/07 17:42:44 - SharedObjects - Reading the shared objects file [file:///C:/Documents and Settings/rcornejo/.kettle/shared.xml]
    2008/11/07 17:42:44 - org.pentaho.di.trans.TransMeta - The used shared objects file 'null' doesn't contain any shared objects (or doesn't exist).
    2008/11/07 17:42:44 - org.pentaho.di.trans.TransMeta - We have 1 connections...
    2008/11/07 17:42:44 - org.pentaho.di.trans.TransMeta - Looking at connection #0
    2008/11/07 17:42:44 - org.pentaho.di.trans.TransMeta - Reading 3 steps...
    2008/11/07 17:42:44 - org.pentaho.di.trans.TransMeta - Looking at step #0
    2008/11/07 17:42:44 - StepMeta() - looking for the right step node (Modified Java Script Value)
    2008/11/07 17:42:44 - StepMeta() - specifics loaded for Modified Java Script Value
    2008/11/07 17:42:44 - StepMeta() - end of readXML()
    2008/11/07 17:42:44 - org.pentaho.di.trans.TransMeta - Looking at step #1
    2008/11/07 17:42:44 - StepMeta() - looking for the right step node (Table input)
    2008/11/07 17:42:44 - StepMeta() - specifics loaded for Table input
    2008/11/07 17:42:44 - StepMeta() - end of readXML()
    2008/11/07 17:42:44 - org.pentaho.di.trans.TransMeta - Looking at step #2
    2008/11/07 17:42:44 - StepMeta() - looking for the right step node (Text file output)
    2008/11/07 17:42:44 - StepMeta() - specifics loaded for Text file output
    2008/11/07 17:42:44 - StepMeta() - end of readXML()
    2008/11/07 17:42:44 - org.pentaho.di.trans.TransMeta - We have 2 hops...
    2008/11/07 17:42:44 - org.pentaho.di.trans.TransMeta - Looking at hop #0
    2008/11/07 17:42:44 - org.pentaho.di.trans.TransMeta - Looking at hop #1
    2008/11/07 17:42:44 - norman - nr of steps read : 3
    2008/11/07 17:42:44 - norman - nr of hops read : 2
    2008/11/07 17:42:44 - org.pentaho.di.ui.spoon.trans.TransGraph - Transformation opened.
    2008/11/07 17:42:44 - Spoon - Launching transformation [norman]...
    2008/11/07 17:42:44 - Spoon - Started the transformation execution.
    2008/11/07 17:42:44 - norman - Dispatching started for transformation [norman]
    2008/11/07 17:42:44 - norman - Nr of arguments detected:0
    2008/11/07 17:42:44 - norman - This is not a replay transformation
    2008/11/07 17:42:44 - norman - I found 3 different steps to launch.
    2008/11/07 17:42:44 - norman - Allocating rowsets...
    2008/11/07 17:42:44 - norman - Allocating rowsets for step 0 --> Modified Java Script Value
    2008/11/07 17:42:44 - norman - prevcopies = 1, nextcopies=1
    2008/11/07 17:42:44 - norman - Transformation allocated new rowset [Modified Java Script Value.0 - Table input.0]
    2008/11/07 17:42:44 - norman - Allocated 1 rowsets for step 0 --> Modified Java Script Value
    2008/11/07 17:42:44 - norman - Allocating rowsets for step 1 --> Table input
    2008/11/07 17:42:44 - norman - prevcopies = 1, nextcopies=1
    2008/11/07 17:42:44 - norman - Transformation allocated new rowset [Table input.0 - Text file output.0]
    2008/11/07 17:42:44 - norman - Allocated 2 rowsets for step 1 --> Table input
    2008/11/07 17:42:44 - norman - Allocating rowsets for step 2 --> Text file output
    2008/11/07 17:42:44 - norman - Allocated 2 rowsets for step 2 --> Text file output
    2008/11/07 17:42:44 - norman - Allocating Steps & StepData...
    2008/11/07 17:42:44 - norman - Transformation is about to allocate step [Modified Java Script Value] of type [ScriptValueMod]
    2008/11/07 17:42:44 - norman - Step has nrcopies=1
    2008/11/07 17:42:44 - Modified Java Script Value.0 - distribution activated
    2008/11/07 17:42:44 - Modified Java Script Value.0 - Starting allocation of buffers & new threads...
    2008/11/07 17:42:44 - Modified Java Script Value.0 - Step info: nrinput=0 nroutput=1
    2008/11/07 17:42:44 - Modified Java Script Value.0 - output rel. is 1:1
    2008/11/07 17:42:44 - Modified Java Script Value.0 - Found output rowset [Modified Java Script Value.0 - Table input.0]
    2008/11/07 17:42:44 - Modified Java Script Value.0 - Finished dispatching
    2008/11/07 17:42:44 - norman - Transformation has allocated a new step: [Modified Java Script Value].0
    2008/11/07 17:42:44 - norman - Transformation is about to allocate step [Table input] of type [TableInput]
    2008/11/07 17:42:44 - norman - Step has nrcopies=1
    2008/11/07 17:42:44 - Table input.0 - distribution activated
    2008/11/07 17:42:44 - Table input.0 - Starting allocation of buffers & new threads...
    2008/11/07 17:42:44 - Table input.0 - Step info: nrinput=1 nroutput=1
    2008/11/07 17:42:44 - Table input.0 - Got previous step from [Table input] #0 --> Modified Java Script Value
    2008/11/07 17:42:44 - Table input.0 - input rel is 1:1
    2008/11/07 17:42:44 - Table input.0 - Found input rowset [Modified Java Script Value.0 - Table input.0]
    2008/11/07 17:42:44 - Table input.0 - output rel. is 1:1
    2008/11/07 17:42:44 - Table input.0 - Found output rowset [Table input.0 - Text file output.0]
    2008/11/07 17:42:44 - Table input.0 - Finished dispatching
    2008/11/07 17:42:44 - norman - Transformation has allocated a new step: [Table input].0
    2008/11/07 17:42:44 - norman - Transformation is about to allocate step [Text file output] of type [TextFileOutput]
    2008/11/07 17:42:44 - norman - Step has nrcopies=1
    2008/11/07 17:42:44 - Text file output.0 - distribution activated
    2008/11/07 17:42:44 - Text file output.0 - Starting allocation of buffers & new threads...
    2008/11/07 17:42:44 - Text file output.0 - Step info: nrinput=1 nroutput=0
    2008/11/07 17:42:44 - Text file output.0 - Got previous step from [Text file output] #0 --> Table input
    2008/11/07 17:42:44 - Text file output.0 - input rel is 1:1
    2008/11/07 17:42:44 - Text file output.0 - Found input rowset [Table input.0 - Text file output.0]
    2008/11/07 17:42:44 - Text file output.0 - Finished dispatching
    2008/11/07 17:42:44 - norman - Transformation has allocated a new step: [Text file output].0
    2008/11/07 17:42:44 - norman - This transformation can be replayed with replay date: 2008/11/07 17:42:44
    2008/11/07 17:42:44 - norman - Initialising 3 steps...
    2008/11/07 17:42:44 - Modified Java Script Value.0 - Running on slave server #0/1.
    2008/11/07 17:42:44 - Text file output.0 - Running on slave server #0/1.
    2008/11/07 17:42:44 - Table input.0 - Running on slave server #0/1.
    2008/11/07 17:42:44 - Text file output.0 - Opening output stream in nocompress mode
    2008/11/07 17:42:44 - mysql - New database connection defined
    2008/11/07 17:42:44 - Text file output.0 - Opening output stream in default encoding
    2008/11/07 17:42:44 - Text file output.0 - Opened new file with name [C:\Documents and Settings\rcornejo\Escritorio\Archivos salidas\prueba_param.txt]
    2008/11/07 17:42:44 - mysql - Connected to database.
    2008/11/07 17:42:44 - mysql - Auto commit off
    2008/11/07 17:42:44 - Table input.0 - Connected to database...
    2008/11/07 17:42:44 - norman - Step [Modified Java Script Value.0] initialized flawlessly.
    2008/11/07 17:42:44 - norman - Step [Table input.0] initialized flawlessly.
    2008/11/07 17:42:44 - norman - Step [Text file output.0] initialized flawlessly.
    2008/11/07 17:42:44 - norman - Transformation has allocated 3 threads and 2 rowsets.
    2008/11/07 17:42:44 - Table input.0 - Starting to run...
    2008/11/07 17:42:44 - Table input.0 - Reading query parameters from stream [Modified Java Script Value]
    2008/11/07 17:42:44 - Modified Java Script Value.0 - Starting to run...
    2008/11/07 17:42:44 - Table input.0 - Reading from step [Modified Java Script Value]
    2008/11/07 17:42:44 - Modified Java Script Value.0 - Signaling 'output done' to 1 output rowsets.
    2008/11/07 17:42:44 - Text file output.0 - Starting to run...
    2008/11/07 17:42:44 - Modified Java Script Value.0 - Finished processing (I=0, O=0, R=0, W=0, U=0, E=0)
    2008/11/07 17:42:45 - Table input.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : Unexpected error :
    2008/11/07 17:42:45 - Table input.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : org.pentaho.di.core.exception.KettleException:
    2008/11/07 17:42:45 - Table input.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : Expected to read parameters from step [Modified Java Script Value] but none were found.
    2008/11/07 17:42:45 - Table input.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) :
    2008/11/07 17:42:45 - Table input.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at org.pentaho.di.trans.steps.tableinput.TableInput.r eadStartDate(TableInput.java:72)
    2008/11/07 17:42:45 - Table input.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at org.pentaho.di.trans.steps.tableinput.TableInput.p rocessRow(TableInput.java:106)
    2008/11/07 17:42:45 - Table input.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at org.pentaho.di.trans.step.BaseStep.runStepThread(B aseStep.java:2654)
    2008/11/07 17:42:45 - Table input.0 - ERROR (version 3.1.0-RC1, build 771 from 2008/07/08 11:57:26) : at org.pentaho.di.trans.steps.tableinput.TableInput.r un(TableInput.java:343)
    2008/11/07 17:42:45 - mysql - Statement canceled!
    2008/11/07 17:42:45 - mysql - Statement canceled!
    2008/11/07 17:42:45 - Table input.0 - Finished reading query, closing connection.
    2008/11/07 17:42:45 - mysql - Commit on database connection [mysql]
    2008/11/07 17:42:45 - mysql - Connection to database closed!
    2008/11/07 17:42:45 - Text file output.0 - Signaling 'output done' to 0 output rowsets.
    2008/11/07 17:42:45 - Text file output.0 - Closing output stream
    2008/11/07 17:42:45 - Table input.0 - Finished processing (I=0, O=0, R=0, W=0, U=0, E=1)
    2008/11/07 17:42:45 - Text file output.0 - Closed output stream

    Good Afternoon. I need help please, with this error. When the parameters came of Java Script be little more than an interesting exercise. Help me please. Note my english is not good

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

    Default

    Please don't hijack posts, star a new thread if it's about something new ... in your case you probably don't trigger your javascript step so that doesn't trigger a row to your table input which expects a row.

    Regards,
    Sven

+ Reply to Thread

Posting Permissions

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