pepijnve opened a new pull request, #18329: URL: https://github.com/apache/datafusion/pull/18329
## Which issue does this PR close? - Closes #18056 - Part of #18075 ## Rationale for this change When `CaseExpr` needs to evaluate a `PhysicalExpr` for a subset of the rows of the input `RecordBatch` it will first filter the record batch using a selection vector. This filter steps filters all columns of the `RecordBatch`, including ones that may not be accessed by the `PhysicalExpr`. For wide (many columns) record batches and narrow expressions (few column references) it can be beneficial to project the record batch first to reduce the amount of wasted filtering work. ## What changes are included in this PR? - Determines the set of columns used by the sub expressions of a case expression - Derives a projection vector from this set - Derives sub expressions using the projection vector - When appropriate, projects incoming record batches and uses the projected sub expressions for evaluation ## Are these changes tested? - Covered by existing tests ## Are there any user-facing changes? No -- 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]
