@@ -47,56 +47,82 @@ pub type GenericError = Box<dyn Error + Send + Sync>;
47
47
#[ derive( Debug ) ]
48
48
pub enum DataFusionError {
49
49
/// Error returned by arrow.
50
+ ///
50
51
/// 2nd argument is for optional backtrace
51
52
ArrowError ( ArrowError , Option < String > ) ,
52
- /// Wraps an error from the Parquet crate
53
+ /// Error when reading / writing Parquet data.
53
54
#[ cfg( feature = "parquet" ) ]
54
55
ParquetError ( ParquetError ) ,
55
- /// Wraps an error from the Avro crate
56
+ /// Error when reading Avro data.
56
57
#[ cfg( feature = "avro" ) ]
57
58
AvroError ( AvroError ) ,
58
- /// Wraps an error from the object_store crate
59
+ /// Error when reading / writing to / from an object_store (e.g. S3 or LocalFile)
59
60
#[ cfg( feature = "object_store" ) ]
60
61
ObjectStore ( object_store:: Error ) ,
61
- /// Error associated to I/O operations and associated traits.
62
+ /// Error when an I/O operation fails
62
63
IoError ( io:: Error ) ,
63
- /// Error returned when SQL is syntactically incorrect.
64
+ /// Error when SQL is syntactically incorrect.
65
+ ///
64
66
/// 2nd argument is for optional backtrace
65
67
SQL ( ParserError , Option < String > ) ,
66
- /// Error returned on a branch that we know it is possible
67
- /// but to which we still have no implementation for.
68
- /// Often, these errors are tracked in our issue tracker.
68
+ /// Error when a feature is not yet implemented.
69
+ ///
70
+ /// These errors are sometimes returned for features that are still in
71
+ /// development and are not entirely complete. Often, these errors are
72
+ /// tracked in our issue tracker.
69
73
NotImplemented ( String ) ,
70
- /// Error returned as a consequence of an error in DataFusion.
71
- /// This error should not happen in normal usage of DataFusion.
74
+ /// Error due to bugs in DataFusion
72
75
///
73
- /// DataFusions has internal invariants that the compiler is not
74
- /// always able to check. This error is raised when one of those
75
- /// invariants is not verified during execution.
76
+ /// This error should not happen in normal usage of DataFusion. It results
77
+ /// from something that wasn't expected/anticipated by the implementation
78
+ /// and that is most likely a bug (the error message even encourages users
79
+ /// to open a bug report). A user should not be able to trigger internal
80
+ /// errors under normal circumstances by feeding in malformed queries, bad
81
+ /// data, etc.
82
+ ///
83
+ /// Note that I/O errors (or any error that happens due to external systems)
84
+ /// do NOT fall under this category. See other variants such as
85
+ /// [`Self::IoError`] and [`Self::External`].
86
+ ///
87
+ /// DataFusions has internal invariants that the compiler is not always able
88
+ /// to check. This error is raised when one of those invariants does not
89
+ /// hold for some reason.
76
90
Internal ( String ) ,
77
- /// This error happens whenever a plan is not valid. Examples include
78
- /// impossible casts.
91
+ /// Error during planning of the query.
92
+ ///
93
+ /// This error happens when the user provides a bad query or plan, for
94
+ /// example the user attempts to call a function that doesn't exist, or if
95
+ /// the types of a function call are not supported.
79
96
Plan ( String ) ,
80
- /// This error happens when an invalid or unsupported option is passed
81
- /// in a SQL statement
97
+ /// Error for invalid or unsupported configuration options.
82
98
Configuration ( String ) ,
83
- /// This error happens with schema-related errors, such as schema inference not possible
84
- /// and non-unique column names.
99
+ /// Error when there is a problem with the query related to schema.
100
+ ///
101
+ /// This error can be returned in cases such as when schema inference is not
102
+ /// possible and when column names are not unique.
103
+ ///
85
104
/// 2nd argument is for optional backtrace
86
105
/// Boxing the optional backtrace to prevent <https://rust-lang.github.io/rust-clippy/master/index.html#/result_large_err>
87
106
SchemaError ( SchemaError , Box < Option < String > > ) ,
88
- /// Error returned during execution of the query.
89
- /// Examples include files not found, errors in parsing certain types.
107
+ /// Error during execution of the query.
108
+ ///
109
+ /// This error is returned when an error happens during execution due to a
110
+ /// malformed input. For example, the user passed malformed arguments to a
111
+ /// SQL method, opened a CSV file that is broken, or tried to divide an
112
+ /// integer by zero.
90
113
Execution ( String ) ,
91
- /// This error is thrown when a consumer cannot acquire memory from the Memory Manager
92
- /// we can just cancel the execution of the partition.
114
+ /// Error when resources (such as memory of scratch disk space) are exhausted.
115
+ ///
116
+ /// This error is thrown when a consumer cannot acquire additional memory
117
+ /// or other resources needed to execute the query from the Memory Manager.
93
118
ResourcesExhausted ( String ) ,
94
119
/// Errors originating from outside DataFusion's core codebase.
120
+ ///
95
121
/// For example, a custom S3Error from the crate datafusion-objectstore-s3
96
122
External ( GenericError ) ,
97
123
/// Error with additional context
98
124
Context ( String , Box < DataFusionError > ) ,
99
- /// Errors originating from either mapping LogicalPlans to/from Substrait plans
125
+ /// Errors from either mapping LogicalPlans to/from Substrait plans
100
126
/// or serializing/deserializing protobytes to Substrait plans
101
127
Substrait ( String ) ,
102
128
}
0 commit comments