alamb commented on a change in pull request #643:
URL: https://github.com/apache/arrow-rs/pull/643#discussion_r683414760
##########
File path: parquet/src/column/writer.rs
##########
@@ -1687,6 +1687,137 @@ mod tests {
);
}
+ #[test]
+ fn test_bool_statistics() {
+ let stats = statistics_roundtrip::<BoolType>(&[true, false, false,
true]);
+ assert!(stats.has_min_max_set());
+ // should this be BooleanStatistics??
+ if let Statistics::Int32(stats) = stats {
Review comment:
Filed https://github.com/apache/arrow-rs/issues/659 to track
##########
File path: parquet/src/column/writer.rs
##########
@@ -1687,6 +1687,128 @@ mod tests {
);
}
+ #[test]
+ fn test_bool_statistics() {
+ let stats = statistics_roundtrip::<BoolType>(&[true, false, false,
true]);
+ assert!(stats.has_min_max_set());
+ // should it be BooleanStatistics??
+ // https://github.com/apache/arrow-rs/issues/659
+ if let Statistics::Int32(stats) = stats {
+ assert_eq!(stats.min(), &0);
+ assert_eq!(stats.max(), &1);
+ } else {
+ panic!("expecting Statistics::Int32, got {:?}", stats);
+ }
+ }
+
+ #[test]
+ fn test_int32_statistics() {
+ let stats = statistics_roundtrip::<Int32Type>(&[-1, 3, -2, 2]);
+ assert!(stats.has_min_max_set());
+ if let Statistics::Int32(stats) = stats {
+ assert_eq!(stats.min(), &-2);
+ assert_eq!(stats.max(), &3);
+ } else {
+ panic!("expecting Statistics::Int32, got {:?}", stats);
+ }
+ }
+
+ #[test]
+ fn test_int64_statistics() {
+ let stats = statistics_roundtrip::<Int64Type>(&[-1, 3, -2, 2]);
+ assert!(stats.has_min_max_set());
+ if let Statistics::Int64(stats) = stats {
+ assert_eq!(stats.min(), &-2);
+ assert_eq!(stats.max(), &3);
+ } else {
+ panic!("expecting Statistics::Int64, got {:?}", stats);
+ }
+ }
+
+ #[test]
+ fn test_int96_statistics() {
Review comment:
Fixed Int96 stats test
--
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]