pepijnve commented on code in PR #16398: URL: https://github.com/apache/datafusion/pull/16398#discussion_r2152483273
########## 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: That would make sense indeed. ExecutionPlan fulfills the role of a factory of Streams. DataSourceExec delegates that to the DataSource itself. So Datasource is actually the factory. It would make sense to delegate the 'will you create something cooperative?' query as well. -- 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