Michael-J-Ward commented on code in PR #6257:
URL: https://github.com/apache/arrow-rs/pull/6257#discussion_r1720152019
##########
parquet/src/file/statistics.rs:
##########
@@ -244,20 +257,21 @@ pub fn from_thrift(
pub fn to_thrift(stats: Option<&Statistics>) -> Option<TStatistics> {
let stats = stats?;
- // record null counts if greater than zero.
- //
- // TODO: This should be Some(0) if there are no nulls.
- // see https://github.com/apache/arrow-rs/pull/6216/files
+ // record null count if it can fit in i64
let null_count = stats
.null_count_opt()
- .map(|value| value as i64)
- .filter(|&x| x > 0);
Review Comment:
I was intrigued, so went to do some code archaeology, but that `filter` was
only introduced a few days ago in #6216, by you! :smile:
For 6 years before it was:
```rust
null_count: if stats.has_nulls() {
Some(stats.null_count() as
} else {
None
},
```
Your commit:
https://github.com/apache/arrow-rs/pull/6216/commits/7d4e65076f9b1ea61f6931a670436cc08f4f629a
Prior code:
https://github.com/apache/arrow-rs/blame/25bfccca58ff219d9f59ba9f4d75550493238a4f/parquet/src/file/statistics.rs#L228-L242
--
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]