@@ -33,13 +33,14 @@ mod tests {
3333 use datafusion_common:: test_util:: batches_to_string;
3434 use datafusion_common:: { test_util, Result , ScalarValue } ;
3535 use datafusion_datasource:: file_format:: FileFormat ;
36- use datafusion_datasource:: file_scan_config:: FileScanConfig ;
36+ use datafusion_datasource:: file_scan_config:: FileScanConfigBuilder ;
3737 use datafusion_datasource:: PartitionedFile ;
3838 use datafusion_datasource_avro:: source:: AvroSource ;
3939 use datafusion_datasource_avro:: AvroFormat ;
4040 use datafusion_execution:: object_store:: ObjectStoreUrl ;
4141 use datafusion_physical_plan:: ExecutionPlan ;
4242
43+ use datafusion_datasource:: source:: DataSourceExec ;
4344 use futures:: StreamExt ;
4445 use insta:: assert_snapshot;
4546 use object_store:: chunked:: ChunkedStore ;
@@ -81,12 +82,16 @@ mod tests {
8182 . await ?;
8283
8384 let source = Arc :: new ( AvroSource :: new ( ) ) ;
84- let conf =
85- FileScanConfig :: new ( ObjectStoreUrl :: local_filesystem ( ) , file_schema, source)
86- . with_file ( meta. into ( ) )
87- . with_projection ( Some ( vec ! [ 0 , 1 , 2 ] ) ) ;
88-
89- let source_exec = conf. build ( ) ;
85+ let conf = FileScanConfigBuilder :: new (
86+ ObjectStoreUrl :: local_filesystem ( ) ,
87+ file_schema,
88+ source,
89+ )
90+ . with_file ( meta. into ( ) )
91+ . with_projection ( Some ( vec ! [ 0 , 1 , 2 ] ) )
92+ . build ( ) ;
93+
94+ let source_exec = DataSourceExec :: from_data_source ( conf) ;
9095 assert_eq ! (
9196 source_exec
9297 . properties( )
@@ -153,11 +158,12 @@ mod tests {
153158 let projection = Some ( vec ! [ 0 , 1 , 2 , actual_schema. fields( ) . len( ) ] ) ;
154159
155160 let source = Arc :: new ( AvroSource :: new ( ) ) ;
156- let conf = FileScanConfig :: new ( object_store_url, file_schema, source)
161+ let conf = FileScanConfigBuilder :: new ( object_store_url, file_schema, source)
157162 . with_file ( meta. into ( ) )
158- . with_projection ( projection) ;
163+ . with_projection ( projection)
164+ . build ( ) ;
159165
160- let source_exec = conf . build ( ) ;
166+ let source_exec = DataSourceExec :: from_data_source ( conf ) ;
161167 assert_eq ! (
162168 source_exec
163169 . properties( )
@@ -222,14 +228,15 @@ mod tests {
222228
223229 let projection = Some ( vec ! [ 0 , 1 , file_schema. fields( ) . len( ) , 2 ] ) ;
224230 let source = Arc :: new ( AvroSource :: new ( ) ) ;
225- let conf = FileScanConfig :: new ( object_store_url, file_schema, source)
231+ let conf = FileScanConfigBuilder :: new ( object_store_url, file_schema, source)
226232 // select specific columns of the files as well as the partitioning
227233 // column which is supposed to be the last column in the table schema.
228234 . with_projection ( projection)
229235 . with_file ( partitioned_file)
230- . with_table_partition_cols ( vec ! [ Field :: new( "date" , DataType :: Utf8 , false ) ] ) ;
236+ . with_table_partition_cols ( vec ! [ Field :: new( "date" , DataType :: Utf8 , false ) ] )
237+ . build ( ) ;
231238
232- let source_exec = conf . build ( ) ;
239+ let source_exec = DataSourceExec :: from_data_source ( conf ) ;
233240
234241 assert_eq ! (
235242 source_exec
0 commit comments