@@ -740,20 +740,31 @@ fn roundtrip_parquet_exec_with_pruning_predicate() -> Result<()> {
740
740
let file_source = Arc :: new (
741
741
ParquetSource :: new ( options) . with_predicate ( Arc :: clone ( & file_schema) , predicate) ,
742
742
) ;
743
+ let statistics = Statistics {
744
+ num_rows : Precision :: Inexact ( 100 ) ,
745
+ total_byte_size : Precision :: Inexact ( 1024 ) ,
746
+ column_statistics : Statistics :: unknown_column ( & Arc :: new ( Schema :: new ( vec ! [
747
+ Field :: new( "col" , DataType :: Utf8 , false ) ,
748
+ ] ) ) ) ,
749
+ } ;
743
750
744
- let scan_config =
745
- FileScanConfig :: new ( ObjectStoreUrl :: local_filesystem ( ) , file_schema, file_source)
746
- . with_file_groups ( vec ! [ vec![ PartitionedFile :: new(
747
- "/path/to/file.parquet" . to_string( ) ,
748
- 1024 ,
749
- ) ] ] )
750
- . with_statistics ( Statistics {
751
- num_rows : Precision :: Inexact ( 100 ) ,
752
- total_byte_size : Precision :: Inexact ( 1024 ) ,
753
- column_statistics : Statistics :: unknown_column ( & Arc :: new ( Schema :: new (
754
- vec ! [ Field :: new( "col" , DataType :: Utf8 , false ) ] ,
755
- ) ) ) ,
756
- } ) ;
751
+ let mut scan_config = FileScanConfig {
752
+ object_store_url : ObjectStoreUrl :: local_filesystem ( ) ,
753
+ file_schema,
754
+ file_groups : vec ! [ vec![ PartitionedFile :: new(
755
+ "/path/to/file.parquet" . to_string( ) ,
756
+ 1024 ,
757
+ ) ] ] ,
758
+ constraints : Constraints :: empty ( ) ,
759
+ projection : None ,
760
+ limit : None ,
761
+ table_partition_cols : vec ! [ ] ,
762
+ output_ordering : vec ! [ ] ,
763
+ file_compression_type : FileCompressionType :: UNCOMPRESSED ,
764
+ new_lines_in_values : false ,
765
+ file_source : source,
766
+ } ;
767
+ scan_config = scan_config. with_statistics ( statistics) ;
757
768
758
769
roundtrip_test ( scan_config. build ( ) )
759
770
}
@@ -795,19 +806,32 @@ fn roundtrip_parquet_exec_with_custom_predicate_expr() -> Result<()> {
795
806
. with_predicate ( Arc :: clone ( & file_schema) , custom_predicate_expr) ,
796
807
) ;
797
808
798
- let scan_config =
799
- FileScanConfig :: new ( ObjectStoreUrl :: local_filesystem ( ) , file_schema, file_source)
800
- . with_file_groups ( vec ! [ vec![ PartitionedFile :: new(
801
- "/path/to/file.parquet" . to_string( ) ,
802
- 1024 ,
803
- ) ] ] )
804
- . with_statistics ( Statistics {
805
- num_rows : Precision :: Inexact ( 100 ) ,
806
- total_byte_size : Precision :: Inexact ( 1024 ) ,
807
- column_statistics : Statistics :: unknown_column ( & Arc :: new ( Schema :: new (
808
- vec ! [ Field :: new( "col" , DataType :: Utf8 , false ) ] ,
809
- ) ) ) ,
810
- } ) ;
809
+ let statistics = Statistics {
810
+ num_rows : Precision :: Inexact ( 100 ) ,
811
+ total_byte_size : Precision :: Inexact ( 1024 ) ,
812
+ column_statistics : Statistics :: unknown_column ( & Arc :: new ( Schema :: new ( vec ! [
813
+ Field :: new( "col" , DataType :: Utf8 , false ) ,
814
+ ] ) ) ) ,
815
+ } ;
816
+
817
+ let mut scan_config = FileScanConfig {
818
+ object_store_url : ObjectStoreUrl :: local_filesystem ( ) ,
819
+ file_schema,
820
+ file_groups : vec ! [ vec![ PartitionedFile :: new(
821
+ "/path/to/file.parquet" . to_string( ) ,
822
+ 1024 ,
823
+ ) ] ] ,
824
+ constraints : Constraints :: empty ( ) ,
825
+
826
+ projection : None ,
827
+ limit : None ,
828
+ table_partition_cols : vec ! [ ] ,
829
+ output_ordering : vec ! [ ] ,
830
+ file_compression_type : FileCompressionType :: UNCOMPRESSED ,
831
+ new_lines_in_values : false ,
832
+ file_source : source,
833
+ } ;
834
+ scan_config = scan_config. with_statistics ( statistics) ;
811
835
812
836
#[ derive( Debug , Clone , Eq ) ]
813
837
struct CustomPredicateExpr {
@@ -1587,18 +1611,23 @@ async fn roundtrip_projection_source() -> Result<()> {
1587
1611
1588
1612
let statistics = Statistics :: new_unknown ( & schema) ;
1589
1613
1590
- let file_source = ParquetSource :: default ( ) . with_statistics ( statistics. clone ( ) ) ;
1591
- let scan_config = FileScanConfig :: new (
1592
- ObjectStoreUrl :: local_filesystem ( ) ,
1593
- schema. clone ( ) ,
1594
- file_source,
1595
- )
1596
- . with_file_groups ( vec ! [ vec![ PartitionedFile :: new(
1597
- "/path/to/file.parquet" . to_string( ) ,
1598
- 1024 ,
1599
- ) ] ] )
1600
- . with_statistics ( statistics)
1601
- . with_projection ( Some ( vec ! [ 0 , 1 , 2 ] ) ) ;
1614
+ let source = ParquetSource :: default ( ) . with_statistics ( statistics. clone ( ) ) ;
1615
+ let scan_config = FileScanConfig {
1616
+ object_store_url : ObjectStoreUrl :: local_filesystem ( ) ,
1617
+ file_groups : vec ! [ vec![ PartitionedFile :: new(
1618
+ "/path/to/file.parquet" . to_string( ) ,
1619
+ 1024 ,
1620
+ ) ] ] ,
1621
+ constraints : Constraints :: empty ( ) ,
1622
+ file_schema : schema. clone ( ) ,
1623
+ projection : Some ( vec ! [ 0 , 1 , 2 ] ) ,
1624
+ limit : None ,
1625
+ table_partition_cols : vec ! [ ] ,
1626
+ output_ordering : vec ! [ ] ,
1627
+ file_compression_type : FileCompressionType :: UNCOMPRESSED ,
1628
+ new_lines_in_values : false ,
1629
+ file_source : source,
1630
+ } ;
1602
1631
1603
1632
let filter = Arc :: new (
1604
1633
FilterExec :: try_new (
0 commit comments