parquet::arrow::async_reader::metadata

Function fetch_parquet_metadata

Source
pub async fn fetch_parquet_metadata<F, Fut>(
    fetch: F,
    file_size: usize,
    prefetch: Option<usize>,
) -> Result<ParquetMetaData>
where F: FnMut(Range<usize>) -> Fut + Send, Fut: Future<Output = Result<Bytes>> + Send,
👎Deprecated since 53.1.0: Use ParquetMetaDataReader
Expand description

Fetches parquet metadata

Parameters:

  • fetch: an async function that can fetch byte ranges
  • file_size: the total size of the parquet file
  • footer_size_hint: footer prefetch size (see comments below)

The length of the parquet footer, which contains file metadata, is not known up front. Therefore this function will first issue a request to read the last 8 bytes to determine the footer’s precise length, before issuing a second request to fetch the metadata bytes

If prefetch is Some, this will read the specified number of bytes in the first request, instead of 8, and only issue further requests if additional bytes are needed. Providing a prefetch hint can therefore significantly reduce the number of fetch requests, and consequently latency