dharanad commented on code in PR #11200: URL: https://github.com/apache/datafusion/pull/11200#discussion_r1662961525
########## datafusion/core/src/datasource/physical_plan/parquet/statistics.rs: ########## @@ -903,6 +917,21 @@ macro_rules! get_data_page_statistics { new_empty_array(&DataType::Time64(unit.clone())) } }) + }, + Some(DataType::FixedSizeBinary(size)) => { + Ok(Arc::new( + FixedSizeBinaryArray::from( + [<$stat_type_prefix FixedLenByteArrayDataPageStatsIterator>]::new($iterator).map(|x| { + x.into_iter().filter_map(|x| x).map(|x| { + if x.len().try_into() == Ok(*size) { + Some(x.data().to_vec()) + } else { + None + } + }) + }).flatten().collect::<Vec<_>>() + ) + )) Review Comment: Hello @efredine I'm reaching out because I'm encountering an issue, though you can help me over here. I have tried something like this to solve this issues, but it is failing to fight with borrow checker. I have refered the [docs](https://arrow.apache.org/rust/parquet/data_type/struct.FixedLenByteArray.html#impl-From%3CByteArray%3E-for-FixedLenByteArray) and tried couple of other approachs but nothing worked. ``` error[E0515]: cannot return value referencing function parameter `x` --> datafusion/core/src/datasource/physical_plan/parquet/statistics.rs:927:41 | 927 | Some(x.data()) | ^^^^^-^^^^^^^^ | | | | | `x` is borrowed here | returns a value referencing data owned by the current function ... 1009 | get_data_page_statistics!(Max, data_type, iterator) | --------------------------------------------------- in this macro invocation | = note: this error originates in the macro `get_data_page_statistics` (in Nightly builds, run with -Z macro-backtrace for more info) ``` I was wondering if you might have any insights or suggestions that could help me navigate this borrow checker error. -- 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