haohuaijin commented on code in PR #25731:
URL: https://github.com/apache/datafusion/pull/25731#discussion_r4164459550


##########
datafusion/datasource-parquet/src/access_plan.rs:
##########
@@ -298,6 +299,39 @@ impl ParquetAccessPlan {
         selection: RowSelection,
         row_group_meta_data: &[RowGroupMetaData],
     ) -> Result<Self> {
+        if let Some(mask) = selection.as_mask() {
+            let selection_rows = mask.len();
+            let file_rows = row_group_meta_data
+                .iter()
+                .map(|rg| rg.num_rows() as usize)
+                .sum::<usize>();
+            if selection_rows != file_rows {
+                return exec_err!(
+                    "Invalid Parquet RowSelection. File has {file_rows} rows, \
+                    but selection specifies {selection_rows} rows."
+                );
+            }
+
+            // Slice the bitmap without materializing selectors. Use 
row_count()

Review Comment:
   > So I am not sure how important avoiding split_off is for masks 🤔
   
   we can use `split_off` for mask, i update cde to use `split_off` for mask, 
and split `try_new_from_overall_row_selection` to two different functions. 
updated in 
[8a4d744](https://github.com/apache/datafusion/pull/25731/commits/8a4d7444fa4144d683d5b9851a1a29cf8fee45ac)



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to