Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: Define Error Handling - How to Implement

  1. #1
    Join Date
    Apr 2007
    Posts
    14

    Default Define Error Handling - How to Implement

    Hi All,

    I have been using Kettle for ~ 5 days now & am very impressed with its capabilities. I've just downloaded the latest (2.5 GA) & was wanting to extend my step plugin to support the new "Define Error Handling" functionality. Is any info on the required code mods available? Even if I could get a copy of the latest source code for the Table output that would help.

    Thanks & regards,
    Tim Munro.

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

    Default

    1) The *Meta class should indicate that it supports error handling:

    Code:
        public boolean supportsErrorHandling()
        {
            return true;
        }
    from StepMetaInterface, defaults to false.

    2) In the StepInterface class you can send an "error row" to the "error step" destination using the method

    Code:
    putError(Row row, long nrErrors, String errorDescriptions, String fieldNames, String errorCodes)
    3) Check if error handling is defined:

    Code:
    getStepMeta().isDoingErrorHandling()
    4) See all the error handling details (normally you don't really need it):

    Code:
    getStepMeta().getStepErrorMeta()
    That's all there is to it really. Nice and simple.

    HTH,

    Matt

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

    Default

    You can also check out the source code of-course. We are an open source project.
    Details on how to do that are in the FAQ and in a sticky post on top of this forum.

    HTH,
    Matt

  4. #4
    Join Date
    Apr 2007
    Posts
    14

    Default

    Hey, thanks a heap Matt - for the solution and the extremely prompt response. That works perfectly & does exactly what I want.

    This is a fantastic product, I look fwd to exploring its capabilities more fully.

    Best,
    Tim.

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

    Default

    Yeah, I like the error handling solution as well.
    It allows you to use the Java exception handling and as such there is no performance loss experienced with the use of Error handling.

    For example, the Insert-Update strategy implemented in the Spoon-2.5.0.pdf using 2 steps and Error handling is a lot then the single Insert/Update step because of this.

  6. #6
    Join Date
    Apr 2007
    Posts
    14

    Default Define Error Handling - Possible Bug?

    I say possible because it may be something I'm doing (or not doing). On the release 2.5 GA I've found that the configuration metadata associated with the "Define Error Handling" form does not get saved when you save your Transformation to a Repository (i.e. next time you load the Transformation it shows the green line, rather than the dashed red line & all settings are blank).

    However, when you save your transformation to an xml file it does retain all aforementioned metadata.

    Have I missed something?

    Thanks and regards,
    Tim Munro

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

    Default

    The not saving to the repository was fixed a couple of days ago in SVN. (http://www.javaforge.com/proj/tracke...e&task_id=5514)

    Regards,
    Sven

  8. #8

    Default

    Hi,

    I seem to be running into this situation where, in my custom plugin, I sometimes postpone the emitting of rows until the 'dispose' method. My custom output step processes data in batches and the last batch which may be smaller than the batch size, we process in the dispose method. However, if I want to do putError calls for the elements of this last batch in the dispose method, I'm not seeing error rows being emitted to the error processing step. I do, however, see error rows from the 'normal' batches going to the error processing step.

    Any ideas what might be happening? Is it "too late" to call putError in dispose? I see that TableOutput calls putError in its dispose method so presumably this should work. I'd appreciate any insight!

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.