@@ -184,13 +184,13 @@ impl DataFusionErrorProto {
184184 match inner {
185185 DataFusionErrorInnerProto :: ArrowError ( err) => {
186186 let ( err, ctx) = err. to_arrow_error ( ) ;
187- DataFusionError :: ArrowError ( err, ctx)
187+ DataFusionError :: ArrowError ( Box :: new ( err) , ctx)
188188 }
189189 DataFusionErrorInnerProto :: ParquetError ( err) => {
190- DataFusionError :: ParquetError ( err. to_parquet_error ( ) )
190+ DataFusionError :: ParquetError ( Box :: new ( err. to_parquet_error ( ) ) )
191191 }
192192 DataFusionErrorInnerProto :: ObjectStoreError ( err) => {
193- DataFusionError :: ObjectStore ( err. to_object_store_error ( ) )
193+ DataFusionError :: ObjectStore ( Box :: new ( err. to_object_store_error ( ) ) )
194194 }
195195 DataFusionErrorInnerProto :: IoError ( err) => {
196196 let ( err, _) = err. to_io_error ( ) ;
@@ -200,7 +200,7 @@ impl DataFusionErrorProto {
200200 let backtrace = err. backtrace . clone ( ) ;
201201 let err = err. err . as_ref ( ) . map ( |err| err. to_parser_error ( ) ) ;
202202 let err = err. unwrap_or ( ParserError :: ParserError ( "" . to_string ( ) ) ) ;
203- DataFusionError :: SQL ( err, backtrace)
203+ DataFusionError :: SQL ( Box :: new ( err) , backtrace)
204204 }
205205 DataFusionErrorInnerProto :: NotImplemented ( msg) => {
206206 DataFusionError :: NotImplemented ( msg. clone ( ) )
@@ -212,7 +212,7 @@ impl DataFusionErrorProto {
212212 }
213213 DataFusionErrorInnerProto :: Schema ( err) => {
214214 let ( err, backtrace) = err. to_schema_error ( ) ;
215- DataFusionError :: SchemaError ( err, Box :: new ( backtrace) )
215+ DataFusionError :: SchemaError ( Box :: new ( err) , Box :: new ( backtrace) )
216216 }
217217 DataFusionErrorInnerProto :: Execution ( msg) => DataFusionError :: Execution ( msg. clone ( ) ) ,
218218 // We cannot build JoinErrors ourselves, so instead we map it to internal.
@@ -283,30 +283,32 @@ mod tests {
283283 fn test_datafusion_error_roundtrip ( ) {
284284 let test_cases = vec ! [
285285 DataFusionError :: ArrowError (
286- ArrowError :: ComputeError ( "compute" . to_string( ) ) ,
286+ Box :: new ( ArrowError :: ComputeError ( "compute" . to_string( ) ) ) ,
287287 Some ( "arrow context" . to_string( ) ) ,
288288 ) ,
289- DataFusionError :: ParquetError ( ParquetError :: General ( "parquet error" . to_string( ) ) ) ,
290- DataFusionError :: ObjectStore ( ObjectStoreError :: NotFound {
289+ DataFusionError :: ParquetError ( Box :: new( ParquetError :: General (
290+ "parquet error" . to_string( ) ,
291+ ) ) ) ,
292+ DataFusionError :: ObjectStore ( Box :: new( ObjectStoreError :: NotFound {
291293 path: "test/path" . to_string( ) ,
292294 source: Box :: new( std:: io:: Error :: new( ErrorKind :: NotFound , "not found" ) ) ,
293- } ) ,
295+ } ) ) ,
294296 DataFusionError :: IoError ( IoError :: new(
295297 ErrorKind :: PermissionDenied ,
296298 "permission denied" ,
297299 ) ) ,
298300 DataFusionError :: SQL (
299- ParserError :: ParserError ( "sql parse error" . to_string( ) ) ,
301+ Box :: new ( ParserError :: ParserError ( "sql parse error" . to_string( ) ) ) ,
300302 Some ( "sql backtrace" . to_string( ) ) ,
301303 ) ,
302304 DataFusionError :: NotImplemented ( "not implemented" . to_string( ) ) ,
303305 DataFusionError :: Internal ( "internal error" . to_string( ) ) ,
304306 DataFusionError :: Plan ( "plan error" . to_string( ) ) ,
305307 DataFusionError :: Configuration ( "config error" . to_string( ) ) ,
306308 DataFusionError :: SchemaError (
307- SchemaError :: AmbiguousReference {
308- field: datafusion:: common:: Column :: new_unqualified( "test_field" ) ,
309- } ,
309+ Box :: new ( SchemaError :: AmbiguousReference {
310+ field: Box :: new ( datafusion:: common:: Column :: new_unqualified( "test_field" ) ) ,
311+ } ) ,
310312 Box :: new( None ) ,
311313 ) ,
312314 DataFusionError :: Execution ( "execution error" . to_string( ) ) ,
@@ -377,7 +379,7 @@ mod tests {
377379 #[ test]
378380 fn test_sql_error_with_backtrace ( ) {
379381 let sql_error = DataFusionError :: SQL (
380- ParserError :: ParserError ( "syntax error" . to_string ( ) ) ,
382+ Box :: new ( ParserError :: ParserError ( "syntax error" . to_string ( ) ) ) ,
381383 Some ( "test backtrace" . to_string ( ) ) ,
382384 ) ;
383385
0 commit comments