tustvold commented on code in PR #2677: URL: https://github.com/apache/arrow-datafusion/pull/2677#discussion_r894890298
########## datafusion/core/src/datasource/file_format/parquet.rs: ########## @@ -294,37 +287,50 @@ fn summarize_min_max( } } -/// Read and parse the schema of the Parquet file at location `path` -fn fetch_schema(store: &dyn ObjectStore, file: &FileMeta) -> Result<Schema> { - let object_reader = store.file_reader(file.sized_file.clone())?; - let obj_reader = ChunkObjectReader { - object_reader, - bytes_scanned: None, - }; - let file_reader = Arc::new(SerializedFileReader::new(obj_reader)?); - let mut arrow_reader = ParquetFileArrowReader::new(file_reader); - let schema = arrow_reader.get_schema()?; +async fn fetch_metadata( + store: &dyn ObjectStore, + file: &ObjectMeta, +) -> Result<ParquetMetaData> { + // TODO: Fetching the entire file to get metadata is wasteful Review Comment: Yes, FWIW #2711 fixes this -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org