Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: ArrayIndexOutOfBoundsException in FileSplitter

  1. #1
    Join Date
    Nov 2008
    Posts
    2

    Question ArrayIndexOutOfBoundsException in FileSplitter

    Hello all,

    I've been playing with Kettle 3.1.0 for about a week and have hit an odd error that I can't figure out. I doubt it's a bug or there'd be posts all over about it so I am guessing I'm either doing something really dumb or I don't have something set right in my environment or something

    So here's what I'm trying to do. I have a job that goes and looks in a particular directory and its subfolders for files with a .sav extension. It then passes the file info into a transformation which gets that info with a "Get files from result" block which it then hands off to a Split Fields block where I take the "filename" field and splits on a period into two fields "file" and "extension". As soon as it hits the Split Fields block it blows up with the following:

    2008/11/21 09:26:49 - Split Fields.0 - ERROR (version 3.1.0, build 826 from 2008/09/30 12:32:36) : Unexpected error :
    2008/11/21 09:26:49 - Split Fields.0 - ERROR (version 3.1.0, build 826 from 2008/09/30 12:32:36) : java.lang.ArrayIndexOutOfBoundsException: 11
    2008/11/21 09:26:49 - Split Fields.0 - ERROR (version 3.1.0, build 826 from 2008/09/30 12:32:36) : at org.pentaho.di.trans.steps.fieldsplitter.FieldSplitter.splitField(FieldSplitter.java:88)
    2008/11/21 09:26:49 - Split Fields.0 - ERROR (version 3.1.0, build 826 from 2008/09/30 12:32:36) : at org.pentaho.di.trans.steps.fieldsplitter.FieldSplitter.processRow(FieldSplitter.java:246)
    2008/11/21 09:26:49 - Split Fields.0 - ERROR (version 3.1.0, build 826 from 2008/09/30 12:32:36) : at org.pentaho.di.trans.step.BaseStep.runStepThread(BaseStep.java:2664)
    2008/11/21 09:26:49 - Split Fields.0 - ERROR (version 3.1.0, build 826 from 2008/09/30 12:32:36) : at org.pentaho.di.trans.steps.fieldsplitter.FieldSplitter.run(FieldSplitter.java:274)

    I have no idea where from where this is coming. I've played around a bit and discovered that if I add a Select Values block and eliminate all the fields except "filename" before I go to the "Split Fields" block I get the same error but with a 5 instead of an 11. I also have tried using a "Modified Java Script Value" block instead but it blows up with more or less the same error. Even when I just try to reassign "filename" to a new var.

    I'm confounded. I'm not even trying to do anything really "cool" yet
    OldTransformation.ktrMyJob.kjb
    Attached Files Attached Files

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

    Default

    Attached transformation shows field spliiter works...

    So ... it's probably a combination of your input and select values.

    Make a copy of your transformation... remove everything but the get result from rows, and write that completely to a file. Looking at that file you should see what's wrong, else attach the output file here as well.

    Regards,
    Sven
    Attached Files Attached Files

  3. #3
    Join Date
    Nov 2008
    Posts
    2

    Default My output

    Here's the output. Everything looks fine. Filename is what I expect it to be. Should be a simple matter to spit it. I'm glad my transformation works on someone else's computer. At least I know I'm doing it right.

    filenames.txt

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

    Default

    Attached your file, and your transformation... only thing changed is the csv input to read the file.

    It works for me.

    Regards,
    Sven
    Attached Files Attached Files

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.