thinkharderdev commented on code in PR #3633:
URL: https://github.com/apache/arrow-rs/pull/3633#discussion_r1090549270


##########
parquet/src/arrow/arrow_reader/selection.rs:
##########
@@ -110,8 +111,18 @@ impl RowSelection {
         Self::from_consecutive_ranges(iter, total_rows)
     }
 
+    /// Creates a [`RowSelection`] that will select `limit` rows and skip all 
remaining rows.
+    pub(crate) fn from_limit(limit: usize, total_rows: usize) -> Self {
+        Self {
+            selectors: vec![
+                RowSelector::select(limit),
+                RowSelector::skip(total_rows.saturating_sub(limit)),

Review Comment:
   Cool, I think the main thing it does is just to truncate a final `select` if 
needed, but it can be a lot simpler if we do not need to append a `skip` on the 
end



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