adriangb commented on code in PR #17129:
URL: https://github.com/apache/datafusion/pull/17129#discussion_r2268079864
##########
datafusion/datasource/src/source.rs:
##########
@@ -320,7 +321,39 @@ impl ExecutionPlan for DataSourceExec {
&self,
projection: &ProjectionExec,
) -> Result<Option<Arc<dyn ExecutionPlan>>> {
- self.data_source.try_swapping_with_projection(projection)
+ match self.data_source.try_swapping_with_projection(projection)? {
+ Some(new_plan) => {
+ if let Some(new_data_source_exec) =
+ new_plan.as_any().downcast_ref::<DataSourceExec>()
Review Comment:
I cry every time I see a downcast of a trait to a specific type. I
understand why it's necessary in this case, I think the existing API is to
blame, it's worth moving forward with this to fix the (pretty bad IMO) bug BUT
this is the sort of thing I hope a future refactor will avoid the need for.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]