JingsongLi commented on code in PR #205:
URL: https://github.com/apache/paimon-rust/pull/205#discussion_r3036413193


##########
crates/paimon/src/table/table_scan.rs:
##########
@@ -691,8 +691,14 @@ impl<'a> TableScan<'a> {
             }
         }
 
-        // Apply limit pushdown to reduce the number of splits if possible
-        let splits = self.apply_limit_pushdown(splits);
+        // Apply limit pushdown only when there are no data predicates.
+        // With data predicates, merged_row_count() reflects pre-filter row 
counts,
+        // so stopping early could return fewer rows than the limit after 
filtering.
+        let splits = if data_predicates.is_empty() {

Review Comment:
   In fact, Java engines do not push limits when there is a filter. When 
pushing filters, Java engines require connectors to return which filters can be 
fully effective before pushing limits.
   
   I checked datafusion and it doesn't have this complex filter push logic.



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