Hitachi Vantara Pentaho Community Forums
Results 1 to 20 of 20

Thread: GENERATE ROWS step - Limit Field.

  1. #1

    Question GENERATE ROWS step - Limit Field.

    Hello, I'm trying to use the GENERATE ROWS step.
    I´m trying to put a variable on LIMIT field, and don´t works.
    I´m Kettle version 4.0.

    Help me please.

  2. #2
    Join Date
    Sep 2009
    Posts
    810

    Default

    Hmm... works for me, I defined a named parameter and used it in the limit field. See attached sample.

    Maybe you are using a variable that you are creating in the same transformation? That would not be allowed :-)
    Check out this post to learn about named parameters, they may be what you need. The post also explains why setting and reading a variable in the same transformation is not a good idea.

    http://type-exit.org/adventures-with...ers-in-kettle/

    Cheers


    Slawo
    Attached Files Attached Files

  3. #3

    Default

    I'm doing well and is not working.

    I have attached the files I'm using.

    Thank you.
    Attached Files Attached Files

  4. #4
    Join Date
    Sep 2009
    Posts
    810

    Default

    Hi there,

    Wow, the problem is quite tricky to catch :-) I modified your sample files and attached a revised sample for you.

    It seems that Kettle will prepend a space character when doing Integer to String conversion unless told otherwise. It fails to parse an int with a prepended space when reading the limit field of the generate rows step, however.

    The solution is to specify an explicit format string of 0 for the integer variable when creating the variables.

    I took the liberty to rearrange things a bit and go with 10 hours per year in the revised sample :-)

    Cheers

    Slawo

    Edit: It seems the default conversion mask for integers with a space prepended is there to stay... see http://jira.pentaho.com/browse/PDI-2450
    Attached Files Attached Files
    Last edited by slawomir.chodnicki; 07-27-2010 at 10:18 AM.

  5. #5

    Default

    Was displayed the following error:

    2010/07/27 11:39:00 - Generate Rows.0 - ERROR (version 4.0.0-stable, build 13376 from 2010-06-15 11.00.26 by buildguy) : Unable to parse the number of rows to generate (or set to negative number)


  6. #6
    Join Date
    Sep 2009
    Posts
    810

    Default

    Hmm... what do you mean? Are you getting the error on the sample I attached? It works fine for me on Kettle 3.2 and 4.0. The job executes and transformation2 writes a nice output file...

    Cheers

    Slawo

  7. #7

    Default

    Its transformation 2 works.

    When I adapt to my second transformation gives this error.

  8. #8
    Join Date
    Sep 2009
    Posts
    810

    Default

    I'm sorry but I don't seem to follow you. Would you like to elaborate?

  9. #9

    Default

    I have attached my job.

    Take a look at the error.

    I also use version 4.0 of the Kettle.
    Attached Files Attached Files

  10. #10
    Join Date
    Sep 2009
    Posts
    810

    Default

    You need to set the conversion mask for nr_horas_total in the calculator step to 0

    It works then...

    Cheers

    Slawo

  11. #11

    Default

    I made this change and continued with the same error.

  12. #12
    Join Date
    Sep 2009
    Posts
    810

    Default

    The attached job works for me...
    Attached Files Attached Files

  13. #13

    Default

    Now it worked.

    Only it does not understand what was changed. rsrs

    I compared and not found a difference, can you explain why it worked?

    I thank you very much for your attention.

  14. #14
    Join Date
    Sep 2009
    Posts
    810

    Default

    I just put a 0 into the conversion mask field of the calculator step

    Cheers

    Slawo
    Attached Images Attached Images  

  15. #15

    Default

    Ok

    Thanks again for your patience with me.


  16. #16
    Join Date
    Sep 2009
    Posts
    810

    Default

    No problem, we're here to help

  17. #17

    Default

    Just one more question.

    You can work with variable within the field VALUE?
    Attached Images Attached Images  

  18. #18
    Join Date
    Sep 2009
    Posts
    810

    Default

    hi there,

    currently it is not possible to use a variable there. You should have a "get variable" step further down the row stream to add fields with variable values.

    Cheers

    Slawo

  19. #19

    Default

    Ok Thank you.

  20. #20

    Default Error with variables Generates Rows

    Hello good day.

    I tried to simulate the example with repository connected and gives me the following error.

    For input string: "$ {NR_HORAS_TOTAL}"

    any suggestions???

    thanks

Tags for this 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
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.