You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2024/06/23 06:30:39 UTC

Re: [PR] Boolean parquet get datapage stat [datafusion]

alamb commented on code in PR #11054:
URL: https://github.com/apache/datafusion/pull/11054#discussion_r1649431236


##########
datafusion/core/src/datasource/physical_plan/parquet/statistics.rs:
##########
@@ -613,6 +625,14 @@ macro_rules! get_data_page_statistics {
     ($stat_type_prefix: ident, $data_type: ident, $iterator: ident) => {
         paste! {
             match $data_type {
+                Some(DataType::Boolean) => Ok(Arc::new(
+                    BooleanArray::from_iter(
+                        [<$stat_type_prefix BooleanDataPageStatsIterator>]::new($iterator)
+                            .flatten()
+                            .collect::<Vec<_>>()

Review Comment:
   Maybe we could add a comment here about why the `collect` is required as it is somewhat subtle
   
   ```suggestion
                               // BooleanArray::from_iter required a sized iterator, so collect into Vec first
                               .collect::<Vec<_>>()
   ```



-- 
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-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org