@@ -66,6 +66,7 @@ mod metrics;
66
66
pub mod page_filter;
67
67
mod row_filter;
68
68
mod row_groups;
69
+ mod statistics;
69
70
70
71
pub use metrics:: ParquetFileMetrics ;
71
72
@@ -506,6 +507,7 @@ impl FileOpener for ParquetOpener {
506
507
let file_metadata = builder. metadata ( ) . clone ( ) ;
507
508
let predicate = pruning_predicate. as_ref ( ) . map ( |p| p. as_ref ( ) ) ;
508
509
let mut row_groups = row_groups:: prune_row_groups_by_statistics (
510
+ builder. parquet_schema ( ) ,
509
511
file_metadata. row_groups ( ) ,
510
512
file_range,
511
513
predicate,
@@ -718,28 +720,6 @@ pub async fn plan_to_parquet(
718
720
Ok ( ( ) )
719
721
}
720
722
721
- // Copy from the arrow-rs
722
- // https://github.com/apache/arrow-rs/blob/733b7e7fd1e8c43a404c3ce40ecf741d493c21b4/parquet/src/arrow/buffer/bit_util.rs#L55
723
- // Convert the byte slice to fixed length byte array with the length of 16
724
- fn sign_extend_be ( b : & [ u8 ] ) -> [ u8 ; 16 ] {
725
- assert ! ( b. len( ) <= 16 , "Array too large, expected less than 16" ) ;
726
- let is_negative = ( b[ 0 ] & 128u8 ) == 128u8 ;
727
- let mut result = if is_negative { [ 255u8 ; 16 ] } else { [ 0u8 ; 16 ] } ;
728
- for ( d, s) in result. iter_mut ( ) . skip ( 16 - b. len ( ) ) . zip ( b) {
729
- * d = * s;
730
- }
731
- result
732
- }
733
-
734
- // Convert the bytes array to i128.
735
- // The endian of the input bytes array must be big-endian.
736
- pub ( crate ) fn from_bytes_to_i128 ( b : & [ u8 ] ) -> i128 {
737
- // The bytes array are from parquet file and must be the big-endian.
738
- // The endian is defined by parquet format, and the reference document
739
- // https://github.com/apache/parquet-format/blob/54e53e5d7794d383529dd30746378f19a12afd58/src/main/thrift/parquet.thrift#L66
740
- i128:: from_be_bytes ( sign_extend_be ( b) )
741
- }
742
-
743
723
// Convert parquet column schema to arrow data type, and just consider the
744
724
// decimal data type.
745
725
pub ( crate ) fn parquet_to_arrow_decimal_type (
0 commit comments