alamb commented on issue #21231: URL: https://github.com/apache/datafusion/issues/21231#issuecomment-4194002489
I think the root problem is that currently there is an implicit invariant that for any `PhysicalExpr` all of its children are evaluated against the same `Schema` the Case logic now relies on this implicit invariant which is why you are hitting an error While you can modify case as is proposed in https://github.com/apache/datafusion/pull/21386 that will not protect you from other parts of the DataFusion code relying on the same assumption (either existing or that will be added in the future) Thus I think the "right" way to fix this bug (and avoid potential future bugs) is: 1. Add an API to PhysicalExpr to report `schema column used` 2. Update case to use that API 3. Update your lambda expression implementation so that a `Column` refers to a base table, and rewrite `Column`s that refer to columns created by the lambda, use a different physical expression for them -- 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]
