@@ -33,13 +33,14 @@ mod tests {
33
33
use datafusion_common:: test_util:: batches_to_string;
34
34
use datafusion_common:: { test_util, Result , ScalarValue } ;
35
35
use datafusion_datasource:: file_format:: FileFormat ;
36
- use datafusion_datasource:: file_scan_config:: FileScanConfig ;
36
+ use datafusion_datasource:: file_scan_config:: FileScanConfigBuilder ;
37
37
use datafusion_datasource:: PartitionedFile ;
38
38
use datafusion_datasource_avro:: source:: AvroSource ;
39
39
use datafusion_datasource_avro:: AvroFormat ;
40
40
use datafusion_execution:: object_store:: ObjectStoreUrl ;
41
41
use datafusion_physical_plan:: ExecutionPlan ;
42
42
43
+ use datafusion_datasource:: source:: DataSourceExec ;
43
44
use futures:: StreamExt ;
44
45
use insta:: assert_snapshot;
45
46
use object_store:: chunked:: ChunkedStore ;
@@ -81,12 +82,16 @@ mod tests {
81
82
. await ?;
82
83
83
84
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) ;
90
95
assert_eq ! (
91
96
source_exec
92
97
. properties( )
@@ -153,11 +158,12 @@ mod tests {
153
158
let projection = Some ( vec ! [ 0 , 1 , 2 , actual_schema. fields( ) . len( ) ] ) ;
154
159
155
160
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)
157
162
. with_file ( meta. into ( ) )
158
- . with_projection ( projection) ;
163
+ . with_projection ( projection)
164
+ . build ( ) ;
159
165
160
- let source_exec = conf . build ( ) ;
166
+ let source_exec = DataSourceExec :: from_data_source ( conf ) ;
161
167
assert_eq ! (
162
168
source_exec
163
169
. properties( )
@@ -222,14 +228,15 @@ mod tests {
222
228
223
229
let projection = Some ( vec ! [ 0 , 1 , file_schema. fields( ) . len( ) , 2 ] ) ;
224
230
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)
226
232
// select specific columns of the files as well as the partitioning
227
233
// column which is supposed to be the last column in the table schema.
228
234
. with_projection ( projection)
229
235
. 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 ( ) ;
231
238
232
- let source_exec = conf . build ( ) ;
239
+ let source_exec = DataSourceExec :: from_data_source ( conf ) ;
233
240
234
241
assert_eq ! (
235
242
source_exec
0 commit comments