Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: javascript fails on zero rows transformation

  1. #1
    Join Date
    Oct 2007
    Posts
    19

    Default javascript fails on zero rows transformation

    I have a javascript doing some calculations based on the values of some fields from the input stream. If the input stream has no rows the javascript is being executed but the variables associated with the fields are undefined causing the failure of script, transform and job.

    I can't figure if there is a reason why the javascript should be executed even if there are no rows but I think it could be useful having an option preventig the script from being executed if there are no rows in the input stream (yes, I probobably could devise a test to workaroud the problem but I think the issue is so common that it could be useful to have it builtin).

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

    Default

    Just tried it... if there are no input rows, javascript is not executed using 3.0-RC2

    So show us your transformation, simplified as much as possible.

    Regards,
    Sven

  3. #3
    Join Date
    Oct 2007
    Posts
    19

    Default

    It happens in kettle 2.4.0 using Modified Javascript Value, I didn't test if it has been fixed in later versions.

    Example attached.
    Attached Files Attached Files

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

    Default

    2.4.0 ... lol ... please upgrade to at least 2.5.2 ... some problems have been fixed in the meantime
    I'll check your example this evening with 3.0-RC2.

    Regards,
    Sven

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

    Default

    Solved as of 2.5.1

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.