Dear Wiki user, You have subscribed to a wiki page or wiki category on "Pig Wiki" for change notification.
The following page has been changed by SanthoshSrinivasan: http://wiki.apache.org/pig/PigErrorHandlingFunctionalSpecification ------------------------------------------------------------------------------ The [#cookbook cook book] discusses the classification of errors within Pig and proposes a guideline for exceptions that are to be used by developers. A reclassification of the errors is presented below. === Frontend errors === - The front-end consists of multiple components - parser, type checker, optimizer, translators, etc. These errors usually occur at the client side before the execution begins in Hadoop. All the errors from these components can be categorized as front-end errors. Components that are part of the front end will throw specific exceptions that capture the context. For example, the parser throws a `ParseException`, the type checker will throw a `TypeCheckerException`, the optimizer will throw a `LogicalOptimizerException`, etc. + The front-end consists of multiple components - parser, type checker, optimizer, translators, etc. These errors usually occur at the client side before the execution begins in Hadoop. All the errors from these components can be categorized as front-end errors. Components that are part of the front end will throw specific exceptions that capture the context. For example, the parser throws a `ParseException`, the type checker will throw a `TypeCheckerException`, the optimizer will throw a `LogicalOptimizerException`, etc. A list of the exceptions thrown in the front-end are as follows. + + 1. `ParseException` Used for indicating errors due to parsing + 2. `TypeCheckerException` Used for indicating errors due to type checking + 3. `LogicalOptimizerException` Used for indicating errors during logical plan optimization + 4. `LogicalToPhysicalTranslatorException` Used for indicating errors during logical plan to physical plan translation + 5. `PhysicalToMRTranslatorException` Used for indicating errors during physical plan to map reduce plan translation + 6. `MRJobCompilerException` Used for indicating errors during map reduce plan compilation === Backend errors === The execution pipeline, the operators that form the pipeline and the map reduce classes fall into the back-end. The errors that occur in the back-end are generally at run-time. Exceptions such as `ExecException` and `RunTimeException` fall into this category. These errors will be propagated to the user facing system and an appropriate error message indicating the source of the error will be displayed. @@ -31, +38 @@ == Error codes == - Error codes are categorized into ranges depending on the nature of the error. The following table indicates the ranges for the error types in Pig. + Error codes are categorized into ranges depending on the nature of the error. The following table indicates the ranges for the error types in Pig. Normally, errors due to user input and bugs in the software are not retriable. Errors due to the user environment and remote environment may be retriable based on the context. - || '''Error type''' || '''Range''' || + || '''Error type''' || '''Range''' || - || User Input || 1 - 149 || + || User Input || 1000 - 1999 || - || Bug || 1 - 149 || + || Bug || 2000 - 2999 || + || User Environment (retriable) || 3000 - 3999 || - || User Environment || 150 - 200 || + || User Environment || 4000 - 4999 || + || Remote Environment (retriable) || 5000 - 5999 || - || Remote Environment || 201 - 255 || + || Remote Environment || 6000 - 6999 || - || Reserved for future use || 200 - 255 || - Programmatic access via Java APIs can query if exceptions are retriable or not. For external processes that rely on the return code of the process, if an error is retriable the error code will be negative, if not it will be positive. + + Programmatic access via Java APIs can query if exceptions are retriable or not. For external processes that rely on the return code of the process, the table given below will indicate the status of the process execution. + + || '''Status''' || '''Return Code''' || + || Successful Execution || 0 || + || Retriable error || 1 || + || Fatal error || 2 || == Additional command line switches ==
