Hitachi Vantara Pentaho Community Forums
Results 1 to 10 of 10

Thread: Bug: Error when importing double from a Microsoft Access Database

  1. #1
    Join Date
    Jul 2011
    Posts
    12

    Default Bug: Error when importing double from a Microsoft Access Database

    When importing double from Access it became corrupted. The Kettle engine add several zeros at the end of number for any reason.
    Attached Files Attached Files

  2. #2
    Join Date
    Sep 2009
    Posts
    810

    Default

    Mello Margenn,

    good effort putting a sample together. I would suggest to also tell us the Kettle version you are referring to.
    But to the *bug* at hand. Are you familiar with the format masks Kettle uses to convert numbers to strings (for preview for example)?
    Unless you specify a format mask for the field, the default is going to be used, which I think is something like #.#.

    It is important to understand that the number is kept as a number internally with full precision. Once Kettle has to convert it to a string (for the purposes of preview for example) it is going to use the format mask for that field.

    If you'd like to experiment with it, I'd suggest using different masks like "0", "0.0", "0.00", "#.#####", "#.0" etc. and experiment with different numbers between 0 and 10 to see the effect.

    The formal doc is available here: http://download.oracle.com/javase/6/...malFormat.html


    Cheers
    Slawo

  3. #3
    Join Date
    Jul 2011
    Posts
    12

    Default

    Hello Slawo,

    Thank you for your help. The PDI version I'm using is 4.2.

    The issue is in the number *value* instead the way it is presented. For example: 1 turns into 10.0 and so on.. which can be verified on the attached sample of this thread. I'm aware about the mask use.

    A workaround was pushing the ms access "double" value into a string output and then turn it into a number on the next step. The number is "outputted" as scientific notation (string) and then converted correctly on the next step.

    cheers
    Margenn

  4. #4
    Join Date
    Sep 2009
    Posts
    810

    Default

    Hi margenn,

    that is curious. I was testing with PDI 4.2. and have not seen anything like that happening. Which version of Access have you been using to create the file? And can you confirm the values in the test table for us?

    Cheers
    Slawo

  5. #5
    Join Date
    Jul 2011
    Posts
    12

    Default

    hello slawo

    I just done the double check and inserted mask = #.#
    For numbers until 7 digits OK.
    Additional zeros are still added for 8+ digits

    using: pdi 4.2 and java 6. access 2k3

    cheers
    Margenn

  6. #6
    Join Date
    Sep 2009
    Posts
    810

    Default

    margenn,

    I can't seem to see the issue. Below is what PDI preview vs. Access 2010 are showing me for the test file.

    Name:  cmp.png
Views: 55
Size:  58.0 KB

    Cheers
    Slawo

  7. #7
    Join Date
    Jul 2011
    Posts
    12

    Default

    hello slawo

    Thats weird because im getting the following:
    Did you made any tweak on the transformation I've sent?

    Marcelo
    Attached Images Attached Images  

  8. #8
    Join Date
    Sep 2009
    Posts
    810

    Default

    Hey margenn,

    that looks weird indeed. I've not changed anything in your sample.
    Are you using the 32 bit version of Kettle? There's the remote possibility that 32 vs. 64 bit datatypes are responsible for this. In any case, I'd like you to collect as many details as you can about your environment and create a jira case for this.

    Please include details about OS (32/64 bit), Java version, Java runtime (32/64 bit), Java vendor (we support Sun Java only) and anything else you can think of

    Once we can reproduce it, we can fix it

    Cheers
    Slawo

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

    Default

    I was thinking it might be a locale difference (. and , difference or something similar).

  10. #10
    Join Date
    Jul 2011
    Posts
    12

    Default

    Hello slawo, matt

    The problem disappear when you declare Decimal="." on "Microsoft Access Input => Fields"
    In my country (Brazil) the default decimal is ","

    Thank you

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.