@@ -1527,14 +1527,8 @@ mod tests {
15271527 #[ tokio:: test]
15281528 async fn parquet_exec_with_range ( ) -> Result < ( ) > {
15291529 fn file_range ( meta : & ObjectMeta , start : i64 , end : i64 ) -> PartitionedFile {
1530- PartitionedFile {
1531- object_meta : meta. clone ( ) ,
1532- partition_values : vec ! [ ] ,
1533- range : Some ( FileRange { start, end } ) ,
1534- statistics : None ,
1535- extensions : None ,
1536- metadata_size_hint : None ,
1537- }
1530+ PartitionedFile :: new_from_meta ( meta. clone ( ) )
1531+ . with_range ( start, end)
15381532 }
15391533
15401534 async fn assert_parquet_read (
@@ -1616,21 +1610,14 @@ mod tests {
16161610 . await
16171611 . unwrap ( ) ;
16181612
1619- let partitioned_file = PartitionedFile {
1620- object_meta : meta,
1621- partition_values : vec ! [
1622- ScalarValue :: from( "2021" ) ,
1623- ScalarValue :: UInt8 ( Some ( 10 ) ) ,
1624- ScalarValue :: Dictionary (
1625- Box :: new( DataType :: UInt16 ) ,
1626- Box :: new( ScalarValue :: from( "26" ) ) ,
1627- ) ,
1628- ] ,
1629- range : None ,
1630- statistics : None ,
1631- extensions : None ,
1632- metadata_size_hint : None ,
1633- } ;
1613+ let partitioned_file = PartitionedFile :: new_from_meta ( meta) . with_partition_values ( vec ! [
1614+ ScalarValue :: from( "2021" ) ,
1615+ ScalarValue :: UInt8 ( Some ( 10 ) ) ,
1616+ ScalarValue :: Dictionary (
1617+ Box :: new( DataType :: UInt16 ) ,
1618+ Box :: new( ScalarValue :: from( "26" ) ) ,
1619+ ) ,
1620+ ] ) ;
16341621
16351622 let expected_schema = Schema :: new ( vec ! [
16361623 Field :: new( "id" , DataType :: Int32 , true ) ,
@@ -1711,20 +1698,13 @@ mod tests {
17111698 . unwrap ( )
17121699 . child ( "invalid.parquet" ) ;
17131700
1714- let partitioned_file = PartitionedFile {
1715- object_meta : ObjectMeta {
1716- location,
1717- last_modified : Utc . timestamp_nanos ( 0 ) ,
1718- size : 1337 ,
1719- e_tag : None ,
1720- version : None ,
1721- } ,
1722- partition_values : vec ! [ ] ,
1723- range : None ,
1724- statistics : None ,
1725- extensions : None ,
1726- metadata_size_hint : None ,
1727- } ;
1701+ let partitioned_file = PartitionedFile :: new_from_meta ( ObjectMeta {
1702+ location,
1703+ last_modified : Utc . timestamp_nanos ( 0 ) ,
1704+ size : 1337 ,
1705+ e_tag : None ,
1706+ version : None ,
1707+ } ) ;
17281708
17291709 let file_schema = Arc :: new ( Schema :: empty ( ) ) ;
17301710 let config = FileScanConfigBuilder :: new (
@@ -2376,36 +2356,24 @@ mod tests {
23762356 ) ;
23772357 let config = FileScanConfigBuilder :: new ( store_url, source)
23782358 . with_file (
2379- PartitionedFile {
2380- object_meta : ObjectMeta {
2359+ PartitionedFile :: new_from_meta (
2360+ ObjectMeta {
23812361 location : Path :: from ( name_1) ,
23822362 last_modified : Utc :: now ( ) ,
23832363 size : total_size_1,
23842364 e_tag : None ,
23852365 version : None ,
2386- } ,
2387- partition_values : vec ! [ ] ,
2388- range : None ,
2389- statistics : None ,
2390- extensions : None ,
2391- metadata_size_hint : None ,
2392- }
2366+ }
2367+ )
23932368 . with_metadata_size_hint ( 123 ) ,
23942369 )
2395- . with_file ( PartitionedFile {
2396- object_meta : ObjectMeta {
2397- location : Path :: from ( name_2) ,
2398- last_modified : Utc :: now ( ) ,
2399- size : total_size_2,
2400- e_tag : None ,
2401- version : None ,
2402- } ,
2403- partition_values : vec ! [ ] ,
2404- range : None ,
2405- statistics : None ,
2406- extensions : None ,
2407- metadata_size_hint : None ,
2408- } )
2370+ . with_file ( PartitionedFile :: new_from_meta ( ObjectMeta {
2371+ location : Path :: from ( name_2) ,
2372+ last_modified : Utc :: now ( ) ,
2373+ size : total_size_2,
2374+ e_tag : None ,
2375+ version : None ,
2376+ } ) )
24092377 . build ( ) ;
24102378
24112379 let exec = DataSourceExec :: from_data_source ( config) ;
0 commit comments