adriangb commented on code in PR #16589: URL: https://github.com/apache/datafusion/pull/16589#discussion_r2179009066
########## datafusion/physical-expr-adapter/src/schema_rewriter.rs: ########## @@ -97,13 +101,111 @@ impl<'a> PhysicalExprSchemaRewriter<'a> { &self, expr: Arc<dyn PhysicalExpr>, ) -> Result<Transformed<Arc<dyn PhysicalExpr>>> { + if let Some(transformed) = self.try_rewrite_struct_field_access(&expr)? { + return Ok(Transformed::yes(transformed)); + } + if let Some(column) = expr.as_any().downcast_ref::<Column>() { return self.rewrite_column(Arc::clone(&expr), column); } Ok(Transformed::no(expr)) } + fn try_rewrite_struct_field_access( Review Comment: Basically: I think we need to incorporate your logic from https://github.com/apache/datafusion/pull/1637 into [CastExpr](https://github.com/pydantic/datafusion/blob/0bc7357eddac2277cdf4bda2bf9b14cf93c87eed/datafusion/expr/src/expr.rs#L872). Somewhat related to https://github.com/apache/arrow-rs/issues/6735 -- 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