-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: with_inputs() can use original schema to avoid recompute schema. #7069
Conversation
final_join_result, | ||
Arc::new(join_plan), | ||
join_schema.clone(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
project_schema
isn't necessary equal join_schema
.
Sometime, project_schema
is subset of join_schema
, so recompute schema is more right.
let input_schema = DFSchema::new_with_metadata( | ||
exprlist_to_fields(&projected_expr, &plan)?, | ||
plan.schema().metadata().clone(), | ||
)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's useless, because Projection::try_new(
already contains it,
@@ -482,7 +482,38 @@ impl LogicalPlan { | |||
} | |||
|
|||
pub fn with_new_inputs(&self, inputs: &[LogicalPlan]) -> Result<LogicalPlan> { | |||
from_plan(self, &self.expressions(), inputs) | |||
// with_new_inputs use original expression, | |||
// so we don't need to recompute Schema. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to avoid useless recompution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me. Nice cleanup @jackwener
Which issue does this PR close?
Closes #.
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Don't need
Are there any user-facing changes?