comphead commented on code in PR #2070: URL: https://github.com/apache/datafusion-comet/pull/2070#discussion_r2254675573
########## native/core/src/execution/planner.rs: ########## @@ -1131,12 +1132,26 @@ impl PhysicalPlanner { OpStruct::Limit(limit) => { assert_eq!(children.len(), 1); let num = limit.limit; + let offset: i32 = limit.offset; let (scans, child) = self.create_plan(&children[0], inputs, partition_count)?; - - let limit = Arc::new(LocalLimitExec::new( - Arc::clone(&child.native_plan), - num as usize, - )); + let limit: Arc<dyn ExecutionPlan> = if offset == 0 { + Arc::new(LocalLimitExec::new( + Arc::clone(&child.native_plan), + num as usize, + )) + } else { + let fetch = if num == -1 { + None + } else { + assert!(num >= offset); Review Comment: it is better to return `Err` -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org