In the SPIP: Standardize Exception Messages in Spark, there are three major improvements proposed:
- Group error messages in dedicated files.
- Establish an error message guideline for developers.
- Improve error message quality.
The first step is to centralize error messages for each component into its own dedicated file(s). This can help with auditing error messages and subsequent tasks to establish a guideline and improve message quality in the future.
A general rule of thumb for grouping exceptions:
- AnalysisException => QueryCompilationErrors
- SparkException, RuntimeException(UnsupportedOperationException, IllegalArgumentException...) => QueryExecutionErrors
- ParseException => QueryParsingErrors
(A special case for Command: since commands are executed eagerly, users can immediately see the errors even if the exceptions are thrown in SparkPlan.execute. In this case, we should group the exceptions in commands as QueryCompilationErrors.)
Here is an example RP to group all `AnalysisExcpetion` in Analyzer into QueryCompilationErrors: SPARK-32670
Please see the SPIP for more details.
Exceptions per component: