XiaoHongbo-Hope commented on code in PR #207:
URL: https://github.com/apache/paimon-rust/pull/207#discussion_r3039982656


##########
crates/paimon/src/arrow/reader.rs:
##########
@@ -596,8 +710,12 @@ fn merge_files_by_columns(
         // column that no file contains yet), we still need to emit 
NULL-filled rows to
         // preserve the correct row count.
         if active_file_indices.is_empty() {
-            // All files in a merge group cover the same rows; use the first 
file's row_count.
-            let total_rows = data_files[0].row_count as usize;
+            let first_row_id = data_files[0].first_row_id.unwrap_or(0);
+            let file_row_count = data_files[0].row_count;
+            let total_rows = match &row_ranges {
+                Some(ranges) => expand_selected_row_ids(first_row_id, 
file_row_count, ranges).len(),

Review Comment:
   > nit: in plan phase the ranges in the data split are already 
merge_row_ranges, but the read phase here, it will still do another 
merge_row_ranges? Is it duplicated?
   
   Fixed



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