adriangb opened a new pull request, #27878: URL: https://github.com/apache/datafusion/pull/27878
## Which issue does this PR close? - None. This PR is a preparatory refactor split out of https://github.com/apache/datafusion/pull/27736. ## Rationale for this change `build_predicate_expression` takes six arguments. Three of them do not change while it rewrites one predicate: the schema, the unhandled hook, and the max `IN` list size. Every recursive call passes all three again. This makes the calls long and makes a new setting expensive to add. ## What changes are included in this PR? The PR adds a private `PredicateBuildContext` struct that holds the three settings. `build_predicate_expression` takes one reference to it: ```diff fn build_predicate_expression( expr: &Arc<dyn PhysicalExpr>, - schema: &SchemaRef, + ctx: &PredicateBuildContext, required_columns: &mut RequiredColumns, - unhandled_hook: &Arc<dyn UnhandledPredicateHook>, - max_in_list_size: usize, properties: &mut PruningExpressionProperties, ) -> Arc<dyn PhysicalExpr> ``` `PruningPredicateBuilder` and `PredicateRewriter` build the context and pass it in. ## What is the testing strategy for this PR? The existing tests cover it. The PR changes no behavior and no test expectation. `cargo test -p datafusion-pruning` and `cargo test -p datafusion-datasource-parquet` pass. ## Are there any user-facing changes? No. The struct and the function are private. No public signature changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
