comphead commented on code in PR #7747:
URL: https://github.com/apache/arrow-datafusion/pull/7747#discussion_r1347593226
##########
datafusion/optimizer/src/simplify_expressions/simplify_exprs.rs:
##########
@@ -66,8 +66,16 @@ impl SimplifyExpressions {
let schema = if !plan.inputs().is_empty() {
DFSchemaRef::new(merge_schema(plan.inputs()))
} else if let LogicalPlan::TableScan(scan) = plan {
- // When predicates are pushed into a table scan, there needs to be
- // a schema to resolve the fields against.
+ // When predicates are pushed into a table scan, there is no input
+ // schema to resolve predicates against, so it must be handled
specially
+ //
+ // Note that this is not `plan.schema()` which is the *output*
+ // shema, and reflects any pushed down projection. The output
schema
Review Comment:
```suggestion
// schema, and reflects any pushed down projection. The output
schema
```
--
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]