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/PigErrorHandling
--
Errors that occur in each system should be caught as early as possible. Pig
relies on Hadoop for run time execution. Detection and reporting errors early
will improve turnaround time by avoiding invoking Hadoop till most errors are
fixed. A few examples that demonstrate this behavior are:
1. Syntax errors. E.g.: Missing ';'
- 2. Semantic errors. E.g: Mismatch in cogroup arity
- 3. Validation errors. E.g: Type mismatch when trying to add a string to an
integer
+ 2. Semantic errors. E.g: Mismatch in cogroup arity, Type mismatch when
trying to add a string to an integer
=== Error reporting ===
- Provide users with readable error messages. Stack traces provide a good
mechanism to help debugging but do not mean much to the user. Readable and
simple error messages will be presented on STDERR. Error codes will be devised
for all error messages. Detailed information like stack trace will be logged
into client side logs. The logs will be stored in the current working directory
or the user's home directory. Users can send logs that contain the details of
the error like stack trace to assist developers in resolving issues.
+ Provide users with readable error messages and not just for developers. Stack
traces provide a good mechanism to help debugging but do not mean much to the
user. Readable and simple error messages will be presented on STDERR. Error
codes will be devised for all error messages. The error codes will be
classified into categories to enable further action based on the type of error.
Exceptions will not be swallowed enabling detection of the root cause of the
issue. Detailed information like stack trace will be logged into client side
logs. The logs will be stored in the current working directory or the user's
home directory. The location of the log file will be configurable. Users can
send logs that contain the details of the error like stack trace to assist
developers in resolving issues.
E.g.: For a semantic error like mismatch in cogroup arity, the STDERR
messages and the log messages will look like. Note that this example is used to
illustrate a possible use case.
@@ -86, +85 @@
With the introduction of types and NULLs into Pig, there are several
scenarios where Pig warns the user about introduction of casts, divide by zero
uses, etc. The warning messages are issued on each occurrence of the warning.
While this message is useful, the increased frequency of the messages is
annoying and distracts the user from possible error messages. In order to
alleviate this problem, warning message aggregation will be supported to report
the warning message and the number of occurrences of the warning message. The
warning message and the frequency of each warning message will be presented on
STDERR. The logs will also contain the same information. The location of the
log file will be the same as that of the error log file.
- E.g.:
+ According to the [#ref3 Pig types functional specification], divide by zero
will result in NULL. Pig warns the user about these conversions.
- Warning: Divide by zero: 30 times
+ E.g.: Warning: Divide by zero: 30 times
- Implicit cast to integer: 12 times
+ Similarly, Pig emits warning messages when implicit casts are introduced for
type promotion (adding an integer and a double)
+
+ E.g.: Warning: Implicit cast to double: 12 times
'''Note:'''
@@ -101, +102 @@
1. [[Anchor(ref1)]] Mika Raento, What should Exceptions look like? July
30, 2006, http://www.errorhandling.org/wordpress/
2. [[Anchor(ref2)]] Bruce Eckel, Thinking in Java, 3rd Edition Revision
4.0, November 20, 2002, http://www.faqs.org/docs/think_java/TIJ3_c.htm
+ 3. [[Anchor(ref3)]] Alan Gates, Pig Types Functional Specification, May
19, 2008, http://wiki.apache.org/pig/PigTypesFunctionalSpec
+ == User feedback ==
+
+ The following comments have not been incorporated in the requirements but are
listed for reference.
+
+ 1. Pig should indicate the expression that caused the warning and/or error
message.
+
+ E.g.: B = FILTER A BY (f1 10) and (f2 != 'asdf') and (f3 2L). If f1
requires a cast for the comparison, Pig should indicate that (f1 10) resulted
in the warning.
+
+ 2. Pig should indicate the line number that resulted in the error ala
general purpose programming languages like C++, Java
+
+ 3. Pig should be more transparent. Retries in Hadoop should be communicated
to the user in a programmatic fashion, to allow layers above Pig to take
appropriate action. Pig should also log/share information about the processes,
machines and logs that are spawned by Hadoop to enable users to take quick
action.
+