Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Java Script "random" error (still 2.4)

  1. #1
    Join Date
    Jul 2005
    Posts
    10

    Default Java Script "random" error (still 2.4)

    Hi

    I'm playing with row and prev_row, trying to set a variable =1 when a change occurs in a field between consecutive records.

    I test if COD_LIVELLO has changed and if so I set Cambio_Livello=1.

    The problem is that, even if I do have the same COD_LIVELLO, i get as output some random row with Cambio_Livello=1.

    the unique constant is the row number 257 which is allways wrong.




    below you can see the code

    var prev_row;

    var Cambio_Livello = 0;
    var Promossi = 0;

    if (prev_row == null)
    {
    prev_row = row;
    }
    else
    {
    if (COD_DIPENDENTE.getString() != '@')
    {
    if (
    (row.getString("COD_AMBIENTE","-").equals(prev_row.getString("COD_AMBIENTE", "-")))
    &&
    (row.getString("COD_AZIENDA", "-").equals(prev_row.getString("COD_AZIENDA","-")))
    &&
    (row.getString("COD_DIPENDENTE","-").equals(prev_row.getString("COD_DIPENDENTE", "-")))
    )
    {
    if (
    ((row.getString("COD_LIVELLO", "-").equals(prev_row.getString("COD_LIVELLO", "-"))) == 0) && (Assunto_Mese != 1) //non è il mese di assunzione
    )
    {
    Cambio_Livello = 1;
    }


    }
    }
    prev_row=row;
    }

    ciao
    Emanuele

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

    Default

    I don't see anything obvious.

    - Copy your transformation, remove the javascript and anything following it. Replace it by a text output step. Run the transformation saving the input of javascript to a text file.
    - Copy you transformation again, remove anything but the javascript and use a text input step of the previous bullet to read the data to pass it to the javascript step.

    - Play with the data until you find a set that gives your error consistently and make a new bug tracker at http://jira.pentaho.org/browse/PDI including transformation and data set.

    Regards,
    Sven

  3. #3
    Join Date
    Jul 2005
    Posts
    10

    Default

    I've just tryed to reduce the number of record in input.

    1. 50 rows. OK
    2. 58 rows. Sometime I get errors
    3. 255 rows. Sometime I get errors
    4. 512 rows. I get allways some worng record.

    the error is not reproducibile at all. could it be a memory problem? maybe I set a variable in a wrong way.

    Ciao
    Emanuele

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

    Default

    There are no memory problems in java, just leaks ... If the data is non-confidential raise a tracker at http://jira.pentaho.org/browse/PDI attach your transformation an dataset.

    And possibly also test it with PDI-2.5.1, but I don't recall any specific fixes for such a thing.

    Regards,
    Sven

  5. #5
    Join Date
    Jul 2005
    Posts
    10

    Default

    Hi.

    We have done some more test.

    Our job was made by 4 or 5 serial java script: the result of the first is the input of the second and so on.
    This configuration gave the error.

    Splitting the job into two smaller job resolved our problem.

    Now the question: is there a limit in the number of java script I can serialze? is it funcition of the memory I assign to the JVM?

    Ciao
    Emanuele

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.