@@ -93,7 +93,11 @@ impl RowGroupSet {
93
93
/// Prune remaining row groups to only those within the specified range.
94
94
///
95
95
/// Updates this set to mark row groups that should not be scanned
96
+ ///
97
+ /// # Panics
98
+ /// if `groups.len() != self.len()`
96
99
pub fn prune_by_range ( & mut self , groups : & [ RowGroupMetaData ] , range : & FileRange ) {
100
+ assert_eq ! ( groups. len( ) , self . len( ) ) ;
97
101
for ( idx, metadata) in groups. iter ( ) . enumerate ( ) {
98
102
if !self . should_scan ( idx) {
99
103
continue ;
@@ -120,6 +124,9 @@ impl RowGroupSet {
120
124
///
121
125
/// Note: This method currently ignores ColumnOrder
122
126
/// <https://github.com/apache/datafusion/issues/8335>
127
+ ///
128
+ /// # Panics
129
+ /// if `groups.len() != self.len()`
123
130
pub fn prune_by_statistics (
124
131
& mut self ,
125
132
arrow_schema : & Schema ,
@@ -128,6 +135,7 @@ impl RowGroupSet {
128
135
predicate : & PruningPredicate ,
129
136
metrics : & ParquetFileMetrics ,
130
137
) {
138
+ assert_eq ! ( groups. len( ) , self . len( ) ) ;
131
139
for ( idx, metadata) in groups. iter ( ) . enumerate ( ) {
132
140
if !self . should_scan ( idx) {
133
141
continue ;
@@ -161,13 +169,17 @@ impl RowGroupSet {
161
169
/// [`PruningPredicate`].
162
170
///
163
171
/// Updates this set with row groups that should not be scanned
172
+ ///
173
+ /// # Panics
174
+ /// if the builder does not have the same number of row groups as this set
164
175
pub async fn prune_by_bloom_filters < T : AsyncFileReader + Send + ' static > (
165
176
& mut self ,
166
177
arrow_schema : & Schema ,
167
178
builder : & mut ParquetRecordBatchStreamBuilder < T > ,
168
179
predicate : & PruningPredicate ,
169
180
metrics : & ParquetFileMetrics ,
170
181
) {
182
+ assert_eq ! ( builder. metadata( ) . num_row_groups( ) , self . len( ) ) ;
171
183
for idx in 0 ..self . len ( ) {
172
184
if !self . should_scan ( idx) {
173
185
continue ;
0 commit comments