Hitachi Vantara Pentaho Community Forums
Results 1 to 1 of 1

Thread: DBProc throws ArrayIndexOutOfBoundsException when passing nulls

  1. #1
    Join Date
    Apr 2009
    Posts
    8

    Default DBProc throws ArrayIndexOutOfBoundsException when passing nulls

    I am using this transformation for logging purposes:


    1) Get load stats: It gets statistics about the previously inserted rows (output_row_count, min_id, max_id, min_datetime, max_datetime) from the database.
    2) Get Variables: Variables job_id, job_name and status are added.
    3) Modified Java Script Values: Only used for debugging.
    4) Call DB Procedure: Passing the 8 fields as parameters to a database function which maintains a logging/audit table.

    It works fine when new rows have been inserted at the previous transformation:

    Code:
    2009/08/25 16:36:03 - Modified Java Script Value.0 - job_id: 5691
    2009/08/25 16:36:03 - Modified Java Script Value.0 - job_name: cfh_e
    2009/08/25 16:36:03 - Modified Java Script Value.0 - status: end
    2009/08/25 16:36:03 - Modified Java Script Value.0 - output_row_count: 100
    2009/08/25 16:36:03 - Modified Java Script Value.0 - min_id: 4362196
    2009/08/25 16:36:03 - Modified Java Script Value.0 - max_id: 4362299
    2009/08/25 16:36:03 - Modified Java Script Value.0 - min_datetime: 2009-08-07 11:32:31.0
    2009/08/25 16:36:03 - Modified Java Script Value.0 - max_datetime: 2009-08-07 11:54:18.0
    2009/08/25 16:36:03 - Modified Java Script Value.0 - No tran_Status found. Transformation status checking not available.
    2009/08/25 16:36:03 - DS - DBA setting callableStatement to [{ ? = call log_e_end ( ?,  ?,  ?,  ?,  ?,  ?,  ?,  ?)}]
    2009/08/25 16:36:03 - Modified Java Script Value.0 - No end Script found!
    2009/08/25 16:36:03 - Modified Java Script Value.0 - Signaling 'output done' to 1 output rowsets.
    2009/08/25 16:36:03 - Modified Java Script Value.0 - Finished processing (I=0, O=0, R=1, W=1, U=0, E=0)
    However, it fails with a java.lang.ArrayIndexOutOfBoundsException at the DBProc step when the previous step did not insert any new rows before and min_id, max_id, min_datetime and max_datetime are null.

    Code:
    2009/08/25 16:33:00 - Modified Java Script Value.0 - job_id: 5677
    2009/08/25 16:33:00 - Modified Java Script Value.0 - job_name: cfh_e
    2009/08/25 16:33:00 - Modified Java Script Value.0 - status: end
    2009/08/25 16:33:00 - Modified Java Script Value.0 - output_row_count: 0
    2009/08/25 16:33:00 - Modified Java Script Value.0 - min_id: null
    2009/08/25 16:33:00 - Modified Java Script Value.0 - max_id: null
    2009/08/25 16:33:00 - Modified Java Script Value.0 - min_datetime: null
    2009/08/25 16:33:00 - Modified Java Script Value.0 - max_datetime: null
    2009/08/25 16:33:00 - Modified Java Script Value.0 - No tran_Status found. Transformation status checking not available.
    2009/08/25 16:33:00 - DS - DBA setting callableStatement to [{ ? = call log_e_end ( ?,  ?,  ?,  ?,  ?,  ?,  ?,  ?)}]
    2009/08/25 16:33:00 - org.pentaho.di.trans.steps.dbproc.DBProc - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : Because of an error, this step can't continue: 
    2009/08/25 16:33:00 - org.pentaho.di.trans.steps.dbproc.DBProc - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : Error setting value #9 [max_id Integer(15)] on prepared statement (Integer)
    2009/08/25 16:33:00 - org.pentaho.di.trans.steps.dbproc.DBProc - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : java.lang.ArrayIndexOutOfBoundsException: 8
    2009/08/25 16:33:00 - org.pentaho.di.trans.steps.dbproc.DBProc - ERROR (version 3.2.0-GA, build 10572 from 2009-05-12 08.45.26 by buildguy) : 8
    When I am changing the table input step to replace the null values by some integer/date defaults it is working but I would prefer to pass null values to the database function. Is there any way to achieve this?
    Attached Images Attached Images   

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.