marvinlanhenke commented on code in PR #10852: URL: https://github.com/apache/datafusion/pull/10852#discussion_r1633137006
########## datafusion/core/src/datasource/physical_plan/parquet/statistics.rs: ########## @@ -517,6 +518,72 @@ macro_rules! get_statistics { }}} } +macro_rules! make_data_page_stats_iterator { + ($iterator_type: ident, $func: ident, $index_type: path, $stat_value_type: ty) => { + struct $iterator_type<'a, I> + where + I: Iterator<Item = &'a Index>, + { + iter: I, + } + + impl<'a, I> $iterator_type<'a, I> + where + I: Iterator<Item = &'a Index>, + { + fn new(iter: I) -> Self { + Self { iter } + } + } + + impl<'a, I> Iterator for $iterator_type<'a, I> + where + I: Iterator<Item = &'a Index>, + { + type Item = Vec<Option<$stat_value_type>>; + + fn next(&mut self) -> Option<Self::Item> { + let next = self.iter.next(); + match next { + Some(index) => match index { + $index_type(native_index) => Some( + native_index + .indexes + .iter() + .map(|x| x.$func) + .collect::<Vec<_>>(), Review Comment: Perhaps, there is another way here? Also to avoid the (intermediary) Vec allocation? -- 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...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org