korowa commented on code in PR #5057:
URL: https://github.com/apache/arrow-datafusion/pull/5057#discussion_r1087046084
##########
datafusion/core/src/datasource/file_format/parquet.rs:
##########
@@ -539,6 +542,44 @@ async fn fetch_statistics(
Ok(statistics)
}
+async fn fetch_format_scan_metadata(
+ store: &dyn ObjectStore,
+ table_schema: SchemaRef,
+ file: &ObjectMeta,
+ metadata_size_hint: Option<usize>,
+ collect_statistics: bool,
+ collect_file_ranges: bool,
+) -> Result<FormatScanMetadata> {
+ let mut format_scan_metadata = FormatScanMetadata::default();
+
+ if !collect_statistics && !collect_file_ranges {
+ return Ok(format_scan_metadata);
+ }
+
+ let parquet_metadata =
+ fetch_parquet_metadata(store, file, metadata_size_hint).await?;
+
+ if collect_statistics {
+ format_scan_metadata = format_scan_metadata.with_statistics(
+ extract_statistics_from_metadata(&parquet_metadata, table_schema)?,
+ );
+ };
+
+ if collect_file_ranges {
+ let file_ranges = parquet_metadata
Review Comment:
True, cutting file on N even parts will allow to read only row groups having
their start offset inside corresponding ranges without any duplicate reads or
skipped row groups - so, splitting could be much easier without using metadata
(except for ObjectMetadata for the size)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]