@@ -494,7 +494,9 @@ pub fn parquet_column<'a>(
494494#[ cfg( test) ]
495495mod test {
496496 use crate :: arrow:: ArrowWriter ;
497- use crate :: file:: metadata:: { ParquetMetaData , ParquetMetaDataReader , ParquetMetaDataWriter } ;
497+ use crate :: file:: metadata:: {
498+ ParquetMetaData , ParquetMetaDataOptions , ParquetMetaDataReader , ParquetMetaDataWriter ,
499+ } ;
498500 use crate :: file:: properties:: { EnabledStatistics , WriterProperties } ;
499501 use crate :: schema:: parser:: parse_message_type;
500502 use crate :: schema:: types:: SchemaDescriptor ;
@@ -511,15 +513,17 @@ mod test {
511513 let parquet_bytes = create_parquet_file ( ) ;
512514
513515 // read the metadata from the file WITHOUT the page index structures
516+ let options = ParquetMetaDataOptions :: new ( ) . with_encoding_stats_as_mask ( false ) ;
514517 let original_metadata = ParquetMetaDataReader :: new ( )
515- . with_encoding_stats_as_mask ( false )
518+ . with_metadata_options ( Some ( options ) )
516519 . parse_and_finish ( & parquet_bytes)
517520 . unwrap ( ) ;
518521
519522 // this should error because the page indexes are not present, but have offsets specified
520523 let metadata_bytes = metadata_to_bytes ( & original_metadata) ;
524+ let options = ParquetMetaDataOptions :: new ( ) . with_encoding_stats_as_mask ( false ) ;
521525 let err = ParquetMetaDataReader :: new ( )
522- . with_encoding_stats_as_mask ( false )
526+ . with_metadata_options ( Some ( options ) )
523527 . with_page_indexes ( true ) // there are no page indexes in the metadata
524528 . parse_and_finish ( & metadata_bytes)
525529 . err ( )
@@ -535,8 +539,9 @@ mod test {
535539 let parquet_bytes = create_parquet_file ( ) ;
536540
537541 // read the metadata from the file
542+ let options = ParquetMetaDataOptions :: new ( ) . with_encoding_stats_as_mask ( false ) ;
538543 let original_metadata = ParquetMetaDataReader :: new ( )
539- . with_encoding_stats_as_mask ( false )
544+ . with_metadata_options ( Some ( options ) )
540545 . parse_and_finish ( & parquet_bytes)
541546 . unwrap ( ) ;
542547
@@ -548,8 +553,9 @@ mod test {
548553 "metadata is subset of parquet"
549554 ) ;
550555
556+ let options = ParquetMetaDataOptions :: new ( ) . with_encoding_stats_as_mask ( false ) ;
551557 let roundtrip_metadata = ParquetMetaDataReader :: new ( )
552- . with_encoding_stats_as_mask ( false )
558+ . with_metadata_options ( Some ( options ) )
553559 . parse_and_finish ( & metadata_bytes)
554560 . unwrap ( ) ;
555561
@@ -563,16 +569,18 @@ mod test {
563569
564570 // read the metadata from the file including the page index structures
565571 // (which are stored elsewhere in the footer)
572+ let options = ParquetMetaDataOptions :: new ( ) . with_encoding_stats_as_mask ( false ) ;
566573 let original_metadata = ParquetMetaDataReader :: new ( )
567- . with_encoding_stats_as_mask ( false )
574+ . with_metadata_options ( Some ( options ) )
568575 . with_page_indexes ( true )
569576 . parse_and_finish ( & parquet_bytes)
570577 . unwrap ( ) ;
571578
572579 // read metadata back from the serialized bytes and ensure it is the same
573580 let metadata_bytes = metadata_to_bytes ( & original_metadata) ;
581+ let options = ParquetMetaDataOptions :: new ( ) . with_encoding_stats_as_mask ( false ) ;
574582 let roundtrip_metadata = ParquetMetaDataReader :: new ( )
575- . with_encoding_stats_as_mask ( false )
583+ . with_metadata_options ( Some ( options ) )
576584 . with_page_indexes ( true )
577585 . parse_and_finish ( & metadata_bytes)
578586 . unwrap ( ) ;
0 commit comments