haohuaijin commented on code in PR #10702:
URL: https://github.com/apache/arrow-rs/pull/10702#discussion_r3812289603


##########
parquet/src/arrow/push_decoder/remaining.rs:
##########
@@ -42,21 +44,78 @@ enum QueuedRowGroupDecision {
 struct NextRowGroup {
     row_group_idx: usize,
     row_count: usize,
-    /// This row group's slice of the global selection, or `None` when all rows
-    /// are selected.
+    /// This row group's selection, or `None` when all rows are selected.
     selection: Option<RowSelection>,
     /// Budget snapshot to apply while decoding this row group.
     budget: RowBudget,
 }
 
+#[derive(Debug, Clone)]
+enum QueuedRowGroups {
+    Global {
+        row_groups: VecDeque<usize>,
+        selection: Option<RowSelection>,
+    },
+    PerRowGroup(VecDeque<RowGroupSelection>),
+}
+
+impl QueuedRowGroups {
+    fn front(&self) -> Option<usize> {
+        match self {
+            Self::Global { row_groups, .. } => row_groups.front().copied(),
+            Self::PerRowGroup(row_groups) => row_groups
+                .front()
+                .map(|row_group| row_group.row_group_index),
+        }
+    }
+
+    fn len(&self) -> usize {
+        match self {
+            Self::Global { row_groups, .. } => row_groups.len(),
+            Self::PerRowGroup(row_groups) => row_groups.len(),
+        }
+    }
+
+    fn clear(&mut self) {
+        match self {
+            Self::Global {
+                row_groups,
+                selection,
+            } => {
+                row_groups.clear();
+                *selection = None;
+            }
+            Self::PerRowGroup(row_groups) => row_groups.clear(),
+        }
+    }
+}
+
+/// Number of rows in `row_group_idx`, or an error if the index is out of
+/// bounds for the file.
+fn row_group_num_rows(

Review Comment:
   added `row_group_num_rows` to `ParquetMetaData`



-- 
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]

Reply via email to