@@ -21,7 +21,7 @@ use datafusion::datasource::file_format::FileFormat;
2121use datafusion:: datasource:: physical_plan:: FileScanConfig ;
2222use datafusion:: execution:: SessionState ;
2323use datafusion:: prelude:: SessionContext ;
24- use datafusion_common:: { Constraints , ScalarValue , Statistics } ;
24+ use datafusion_common:: ScalarValue ;
2525use datafusion_physical_expr:: { expressions, PhysicalExpr } ;
2626use datafusion_physical_plan:: projection:: ProjectionExec ;
2727use datafusion_physical_plan:: union:: UnionExec ;
@@ -377,53 +377,32 @@ impl CdfLoadBuilder {
377377 let cdc_scan = ParquetFormat :: new ( )
378378 . create_physical_plan (
379379 session_sate,
380- FileScanConfig {
381- object_store_url : self . log_store . object_store_url ( ) ,
382- file_schema : cdc_file_schema. clone ( ) ,
383- file_groups : cdc_file_groups. into_values ( ) . collect ( ) ,
384- constraints : Constraints :: default ( ) ,
385- statistics : Statistics :: new_unknown ( & cdc_file_schema) ,
386- projection : None ,
387- limit : None ,
388- table_partition_cols : cdc_partition_cols,
389- output_ordering : vec ! [ ] ,
390- } ,
380+ FileScanConfig :: new ( self . log_store . object_store_url ( ) , cdc_file_schema)
381+ . with_file_groups ( cdc_file_groups. into_values ( ) . collect ( ) )
382+ . with_table_partition_cols ( cdc_partition_cols) ,
391383 filters,
392384 )
393385 . await ?;
394386
395387 let add_scan = ParquetFormat :: new ( )
396388 . create_physical_plan (
397389 session_sate,
398- FileScanConfig {
399- object_store_url : self . log_store . object_store_url ( ) ,
400- file_schema : add_remove_file_schema. clone ( ) ,
401- file_groups : add_file_groups. into_values ( ) . collect ( ) ,
402- constraints : Constraints :: default ( ) ,
403- statistics : Statistics :: new_unknown ( & add_remove_file_schema. clone ( ) ) ,
404- projection : None ,
405- limit : None ,
406- table_partition_cols : add_remove_partition_cols. clone ( ) ,
407- output_ordering : vec ! [ ] ,
408- } ,
390+ FileScanConfig :: new (
391+ self . log_store . object_store_url ( ) ,
392+ add_remove_file_schema. clone ( ) ,
393+ )
394+ . with_file_groups ( add_file_groups. into_values ( ) . collect ( ) )
395+ . with_table_partition_cols ( add_remove_partition_cols. clone ( ) ) ,
409396 filters,
410397 )
411398 . await ?;
412399
413400 let remove_scan = ParquetFormat :: new ( )
414401 . create_physical_plan (
415402 session_sate,
416- FileScanConfig {
417- object_store_url : self . log_store . object_store_url ( ) ,
418- file_schema : add_remove_file_schema. clone ( ) ,
419- file_groups : remove_file_groups. into_values ( ) . collect ( ) ,
420- constraints : Constraints :: default ( ) ,
421- statistics : Statistics :: new_unknown ( & add_remove_file_schema) ,
422- projection : None ,
423- limit : None ,
424- table_partition_cols : add_remove_partition_cols,
425- output_ordering : vec ! [ ] ,
426- } ,
403+ FileScanConfig :: new ( self . log_store . object_store_url ( ) , add_remove_file_schema)
404+ . with_file_groups ( remove_file_groups. into_values ( ) . collect ( ) )
405+ . with_table_partition_cols ( add_remove_partition_cols) ,
427406 filters,
428407 )
429408 . await ?;
@@ -434,7 +413,7 @@ impl CdfLoadBuilder {
434413 Arc :: new ( UnionExec :: new ( vec ! [ cdc_scan, add_scan, remove_scan] ) ) ;
435414
436415 // We project the union in the order of the input_schema + cdc cols at the end
437- // This is to ensure the DeltaCdfTableProvider uses the correct schema consturction .
416+ // This is to ensure the DeltaCdfTableProvider uses the correct schema construction .
438417 let mut fields = schema. fields ( ) . to_vec ( ) ;
439418 for f in ADD_PARTITION_SCHEMA . clone ( ) {
440419 fields. push ( f. into ( ) ) ;
0 commit comments