alamb commented on code in PR #4293:
URL: https://github.com/apache/arrow-datafusion/pull/4293#discussion_r1030771314
##########
datafusion/optimizer/src/projection_push_down.rs:
##########
@@ -441,32 +368,16 @@ fn optimize_plan(
}))
}
LogicalPlan::SubqueryAlias(SubqueryAlias { input, alias, .. }) => {
- match input.as_ref() {
- LogicalPlan::TableScan(TableScan { table_name, .. }) => {
- let new_required_columns = new_required_columns
- .iter()
- .map(|c| match &c.relation {
- Some(q) if q == alias => Column {
- relation: Some(table_name.clone()),
- name: c.name.clone(),
- },
- _ => c.clone(),
- })
- .collect();
- let new_inputs = vec![optimize_plan(
- _optimizer,
- input,
- &new_required_columns,
- has_projection,
- _optimizer_config,
- )?];
- let expr = vec![];
- from_plan(plan, &expr, &new_inputs)
- }
- _ => Err(DataFusionError::Plan(
- "SubqueryAlias should only wrap TableScan".to_string(),
- )),
- }
+ let new_required_columns =
Review Comment:
this is a nice cleanup 👍
--
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]