pepijnve commented on code in PR #16398: URL: https://github.com/apache/datafusion/pull/16398#discussion_r2152379108
########## datafusion/datasource/src/source.rs: ########## @@ -261,11 +261,7 @@ impl ExecutionPlan for DataSourceExec { ) -> Result<SendableRecordBatchStream> { self.data_source .open(partition, Arc::clone(&context)) - .map(|stream| wrap_yield_stream(stream, &context, self.cooperative)) - } - - fn with_cooperative_yields(self: Arc<Self>) -> Option<Arc<dyn ExecutionPlan>> { - self.cooperative.then_some(self) + .map(|stream| make_cooperative(stream)) Review Comment: We could avoid a virtual call here by pushing the cooperative wrapper down to `FileScanConfig::open`. That does lose the benefit of `DataSourceExec` being cooperative for any `DataSource`. Is it worth shaving off one virtual call per record batch? -- 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