adriangb commented on issue #19550: URL: https://github.com/apache/datafusion/issues/19550#issuecomment-3719774534
> What if we made a special optimizer pass that only pushed down struct accesses (maybe "Expr::is_trivial" or something else equivalent)? This is the crux of the proposal it's mentioned in the OP: > **Identifying expressions** > I think we should use something like `Expr::is_trivial` from https://github.com/apache/datafusion/pull/19538. We can traverse the tree of expressions for each projection looking for subtrees where every node matches `Expr::is_trivial`. In practice I think it will look like this: `let condition = |expr: &Expr| expr.is_trivial()`. I spoke with @lwwmanning and @AdamGS from Spiral today about this, it sounds like they have (had? attempted to have?) something very similar to this proposal, they landed on something like `fn cost(&self) -> Cost` where `enum Cost { Trivial, NonTrivial }` which would be more extensible towards a cost based model but is otherwise equivalent to a boolean. They also mentioned I think drawing the distinction at metadata-only vs. row-wise (which you also mentioned Andrew). I don't have strong feelings about `is_metadata_operation() -> bool` vs. `is_trivial() -> bool` -- 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]
