@@ -21,7 +21,7 @@ use datafusion::datasource::file_format::FileFormat;
21
21
use datafusion:: datasource:: physical_plan:: FileScanConfig ;
22
22
use datafusion:: execution:: SessionState ;
23
23
use datafusion:: prelude:: SessionContext ;
24
- use datafusion_common:: { Constraints , ScalarValue , Statistics } ;
24
+ use datafusion_common:: ScalarValue ;
25
25
use datafusion_physical_expr:: { expressions, PhysicalExpr } ;
26
26
use datafusion_physical_plan:: projection:: ProjectionExec ;
27
27
use datafusion_physical_plan:: union:: UnionExec ;
@@ -378,53 +378,32 @@ impl CdfLoadBuilder {
378
378
let cdc_scan = ParquetFormat :: new ( )
379
379
. create_physical_plan (
380
380
session_sate,
381
- FileScanConfig {
382
- object_store_url : self . log_store . object_store_url ( ) ,
383
- file_schema : cdc_file_schema. clone ( ) ,
384
- file_groups : cdc_file_groups. into_values ( ) . collect ( ) ,
385
- constraints : Constraints :: default ( ) ,
386
- statistics : Statistics :: new_unknown ( & cdc_file_schema) ,
387
- projection : None ,
388
- limit : None ,
389
- table_partition_cols : cdc_partition_cols,
390
- output_ordering : vec ! [ ] ,
391
- } ,
381
+ FileScanConfig :: new ( self . log_store . object_store_url ( ) , cdc_file_schema)
382
+ . with_file_groups ( cdc_file_groups. into_values ( ) . collect ( ) )
383
+ . with_table_partition_cols ( cdc_partition_cols) ,
392
384
filters,
393
385
)
394
386
. await ?;
395
387
396
388
let add_scan = ParquetFormat :: new ( )
397
389
. create_physical_plan (
398
390
session_sate,
399
- FileScanConfig {
400
- object_store_url : self . log_store . object_store_url ( ) ,
401
- file_schema : add_remove_file_schema. clone ( ) ,
402
- file_groups : add_file_groups. into_values ( ) . collect ( ) ,
403
- constraints : Constraints :: default ( ) ,
404
- statistics : Statistics :: new_unknown ( & add_remove_file_schema. clone ( ) ) ,
405
- projection : None ,
406
- limit : None ,
407
- table_partition_cols : add_remove_partition_cols. clone ( ) ,
408
- output_ordering : vec ! [ ] ,
409
- } ,
391
+ FileScanConfig :: new (
392
+ self . log_store . object_store_url ( ) ,
393
+ add_remove_file_schema. clone ( ) ,
394
+ )
395
+ . with_file_groups ( add_file_groups. into_values ( ) . collect ( ) )
396
+ . with_table_partition_cols ( add_remove_partition_cols. clone ( ) ) ,
410
397
filters,
411
398
)
412
399
. await ?;
413
400
414
401
let remove_scan = ParquetFormat :: new ( )
415
402
. create_physical_plan (
416
403
session_sate,
417
- FileScanConfig {
418
- object_store_url : self . log_store . object_store_url ( ) ,
419
- file_schema : add_remove_file_schema. clone ( ) ,
420
- file_groups : remove_file_groups. into_values ( ) . collect ( ) ,
421
- constraints : Constraints :: default ( ) ,
422
- statistics : Statistics :: new_unknown ( & add_remove_file_schema) ,
423
- projection : None ,
424
- limit : None ,
425
- table_partition_cols : add_remove_partition_cols,
426
- output_ordering : vec ! [ ] ,
427
- } ,
404
+ FileScanConfig :: new ( self . log_store . object_store_url ( ) , add_remove_file_schema)
405
+ . with_file_groups ( remove_file_groups. into_values ( ) . collect ( ) )
406
+ . with_table_partition_cols ( add_remove_partition_cols) ,
428
407
filters,
429
408
)
430
409
. await ?;
@@ -435,7 +414,7 @@ impl CdfLoadBuilder {
435
414
Arc :: new ( UnionExec :: new ( vec ! [ cdc_scan, add_scan, remove_scan] ) ) ;
436
415
437
416
// We project the union in the order of the input_schema + cdc cols at the end
438
- // This is to ensure the DeltaCdfTableProvider uses the correct schema consturction .
417
+ // This is to ensure the DeltaCdfTableProvider uses the correct schema construction .
439
418
let mut fields = schema. fields ( ) . to_vec ( ) ;
440
419
for f in ADD_PARTITION_SCHEMA . clone ( ) {
441
420
fields. push ( f. into ( ) ) ;
0 commit comments