@@ -164,7 +164,7 @@ macro_rules! context {
164164#[ derive( Debug ) ]
165165pub enum SchemaError {
166166 /// Schema contains a (possibly) qualified and unqualified field with same unqualified name
167- AmbiguousReference { field : Column } ,
167+ AmbiguousReference { field : Box < Column > } ,
168168 /// Schema contains duplicate qualified field name
169169 DuplicateQualifiedField {
170170 qualifier : Box < TableReference > ,
@@ -951,14 +951,18 @@ pub fn add_possible_columns_to_diag(
951951
952952#[ cfg( test) ]
953953mod test {
954+ use super :: * ;
955+
954956 use std:: mem:: size_of;
955957 use std:: sync:: Arc ;
956958
957- use crate :: error:: { DataFusionError , GenericError } ;
958959 use arrow:: error:: ArrowError ;
959960
960961 #[ test]
961- fn test_datafusion_error_size ( ) {
962+ fn test_error_size ( ) {
963+ // Since Errors influence the size of Result which influence the size of the stack
964+ // please don't allow this to grow larger
965+ assert_eq ! ( size_of:: <SchemaError >( ) , 40 ) ;
962966 assert_eq ! ( size_of:: <DataFusionError >( ) , 40 ) ;
963967 }
964968
@@ -1128,7 +1132,7 @@ mod test {
11281132 ) ;
11291133
11301134 // assert wrapping other Error
1131- let generic_error: GenericError = Box :: new ( std :: io:: Error :: other ( "io error" ) ) ;
1135+ let generic_error: GenericError = Box :: new ( io:: Error :: other ( "io error" ) ) ;
11321136 let datafusion_error: DataFusionError = generic_error. into ( ) ;
11331137 println ! ( "{}" , datafusion_error. strip_backtrace( ) ) ;
11341138 assert_eq ! (
@@ -1139,7 +1143,7 @@ mod test {
11391143
11401144 #[ test]
11411145 fn external_error_no_recursive ( ) {
1142- let generic_error_1: GenericError = Box :: new ( std :: io:: Error :: other ( "io error" ) ) ;
1146+ let generic_error_1: GenericError = Box :: new ( io:: Error :: other ( "io error" ) ) ;
11431147 let external_error_1: DataFusionError = generic_error_1. into ( ) ;
11441148 let generic_error_2: GenericError = Box :: new ( external_error_1) ;
11451149 let external_error_2: DataFusionError = generic_error_2. into ( ) ;
@@ -1159,7 +1163,7 @@ mod test {
11591163
11601164 /// Model what happens when using arrow kernels in DataFusion
11611165 /// code: need to turn an ArrowError into a DataFusionError
1162- fn return_datafusion_error ( ) -> crate :: error :: Result < ( ) > {
1166+ fn return_datafusion_error ( ) -> Result < ( ) > {
11631167 // Expect the '?' to work
11641168 Err ( ArrowError :: SchemaError ( "bar" . to_string ( ) ) . into ( ) )
11651169 }
0 commit comments