Hitachi Vantara Pentaho Community Forums
Results 1 to 11 of 11

Thread: Upgrade to 3, zero-filled integer value

  1. #1
    Join Date
    Mar 2007
    Posts
    4

    Default Upgrade to 3, zero-filled integer value

    Hi all,

    I use Kettle to extract data from a MySQL 5 db to CSV with the "Table extract" and "File input" nodes. My Job creates a suffix for the name of all extracted files the following way : I have a "ketlle_runs" table with auto_increment integer key and date fields. I perform a blank insert in that table everyday to have the key automatically incremented, then select max value from it, and inject integer value from result set (my suffix for current export) to an "environment variable creation" node. Then that environment variable is used in all filenames :

    So output file for FOOBAR table would be : /myhome/FOOBAR_${RUN_ID}.csv

    What used to happen in 2.4 and 2.5 was that value was correctly fetched from "kettle_runs" table and substitution working fine, I had filenames such as FOOBAR_117.csv for the 117th extract of table FOOBAR.

    Since the upgrade to 3.0 I have the following :
    FOOBAR_ 000000117.csv (there is really a space character in the middle of it).

    Do you think it is linked to a bug or a new behaviour I have to adapt to? Am I providing enough details?

    Cheers
    François

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

    Default

    Don't set the length for that field and you're zero filling won't happen. And use a "mask" to get rid of the space (the space is the place for the sign).

    Regards,
    Sven

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

    Default

    Hi Sven,

    I think we should make "Set Environment Variables" backward compatible with 2.5.
    it should behave like it did in 2.5.x

    Thoughts?

    Matt

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

    Default

    Either we missed set variables in the rollback of explicitly setting the length on the meta-data... or the input comes from somewhere else (either on input, or automatic conversion). I don't remember we set lengths in "Set Variables".

    Regards,
    Sven

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

    Default

    For reference: http://jira.pentaho.org/browse/PDI-482
    I'll fix it right away.

  6. #6
    Join Date
    Mar 2007
    Posts
    4

    Default

    Sven, after checking my steps I can't seem to find any fields that would allow me to set the length and mask for that Env var I'm creating. Any hints for a quick fix ?

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

    Default

    Download these two files and put them in your lib/ directory:

    http://kettle3.s3.amazonaws.com/kettle-engine-3.0.jar
    http://kettle3.s3.amazonaws.com/kettle-ui-swt-3.0.jar

    Try it again and report back on success or failure! Report either here or in the bug report.

    Thanks in advance,

    Matt

  8. #8
    Join Date
    Mar 2007
    Posts
    4

    Default

    Quote Originally Posted by MattCasters View Post
    For reference: http://jira.pentaho.org/browse/PDI-482
    I'll fix it right away.
    Thanks a bunch Matt. From there should I wait for the next release or do you have a patch to provide? If I have to wait for the next release do you have any idea when it would happen (pure approximation of course)? Thanks again.

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

    Default

    See above.

  10. #10
    Join Date
    Mar 2007
    Posts
    4

    Default

    I downloaded the 2 jars and now it works.
    Thank you and congratulations on your reactivty!


    Cheers
    François

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

    Default

    De rien François.

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.