@@ -783,33 +783,18 @@ fn build_row_ranges_selection(
783783struct ArrowFileReader {
784784 file_size : u64 ,
785785 r : Box < dyn FileRead > ,
786- /// Maximum gap (in bytes) between two ranges that will be merged into a
787- /// single fetch request. Defaults to 1 MiB.
788- range_coalesce_bytes : u64 ,
789- /// Maximum number of merged ranges to fetch concurrently. Defaults to 8.
790- range_fetch_concurrency : usize ,
791- /// Hint for the number of bytes to speculatively read from the end of the
792- /// file when loading Parquet metadata. A sufficiently large hint reduces
793- /// footer loading from 2 round-trips to 1. Defaults to 512 KiB.
794- metadata_size_hint : Option < usize > ,
795786}
796787
797788/// Default coalesce threshold: 1 MiB.
798- const DEFAULT_RANGE_COALESCE_BYTES : u64 = 1024 * 1024 ;
789+ const RANGE_COALESCE_BYTES : u64 = 1024 * 1024 ;
799790/// Default concurrent range fetches.
800- const DEFAULT_RANGE_FETCH_CONCURRENCY : usize = 8 ;
791+ const RANGE_FETCH_CONCURRENCY : usize = 8 ;
801792/// Default metadata prefetch hint: 512 KiB.
802- const DEFAULT_METADATA_SIZE_HINT : usize = 512 * 1024 ;
793+ const METADATA_SIZE_HINT : usize = 512 * 1024 ;
803794
804795impl ArrowFileReader {
805796 fn new ( file_size : u64 , r : Box < dyn FileRead > ) -> Self {
806- Self {
807- file_size,
808- r,
809- range_coalesce_bytes : DEFAULT_RANGE_COALESCE_BYTES ,
810- range_fetch_concurrency : DEFAULT_RANGE_FETCH_CONCURRENCY ,
811- metadata_size_hint : Some ( DEFAULT_METADATA_SIZE_HINT ) ,
812- }
797+ Self { file_size, r }
813798 }
814799
815800 fn read_bytes ( & mut self , range : Range < u64 > ) -> BoxFuture < ' _ , parquet:: errors:: Result < Bytes > > {
@@ -835,8 +820,8 @@ impl AsyncFileReader for ArrowFileReader {
835820 & mut self ,
836821 ranges : Vec < Range < u64 > > ,
837822 ) -> BoxFuture < ' _ , parquet:: errors:: Result < Vec < Bytes > > > {
838- let coalesce_bytes = self . range_coalesce_bytes ;
839- let concurrency = self . range_fetch_concurrency . max ( 1 ) ;
823+ let coalesce_bytes = RANGE_COALESCE_BYTES ;
824+ let concurrency = RANGE_FETCH_CONCURRENCY ;
840825
841826 async move {
842827 if ranges. is_empty ( ) {
@@ -893,7 +878,7 @@ impl AsyncFileReader for ArrowFileReader {
893878 options : Option < & ArrowReaderOptions > ,
894879 ) -> BoxFuture < ' _ , parquet:: errors:: Result < Arc < ParquetMetaData > > > {
895880 let metadata_opts = options. map ( |o| o. metadata_options ( ) . clone ( ) ) ;
896- let prefetch_hint = self . metadata_size_hint ;
881+ let prefetch_hint = Some ( METADATA_SIZE_HINT ) ;
897882 Box :: pin ( async move {
898883 let file_size = self . file_size ;
899884 let metadata = ParquetMetaDataReader :: new ( )
0 commit comments