Dandandan commented on a change in pull request #8944:
URL: https://github.com/apache/arrow/pull/8944#discussion_r544622788
##########
File path: rust/datafusion/src/datasource/parquet.rs
##########
@@ -41,10 +41,26 @@ impl ParquetTable {
pub fn try_new(path: &str) -> Result<Self> {
let parquet_exec = ParquetExec::try_new(path, None, 0)?;
let schema = parquet_exec.schema();
+
+ let metadata = parquet_exec.metadata();
+ let num_rows = metadata
+ .row_groups()
+ .iter()
+ .map(|rg| rg.num_rows() as usize)
+ .sum();
+ let total_byte_size = metadata
+ .row_groups()
+ .iter()
+ .map(|rg| rg.total_byte_size() as usize)
Review comment:
I think the as usize could move to below (`Some(num_rows as usize)`).
Than it could use `.map(RowGroupMetaData::total_byte_size)` as well?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]