Skip to content
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

Onyl recompute schema in TypeCoercion when necessary #10365

Open
alamb opened this issue May 3, 2024 · 0 comments · May be fixed by #10369
Open

Onyl recompute schema in TypeCoercion when necessary #10365

alamb opened this issue May 3, 2024 · 0 comments · May be fixed by #10369
Assignees
Labels
enhancement New feature or request

Comments

@alamb
Copy link
Contributor

alamb commented May 3, 2024

Is your feature request related to a problem or challenge?

Part of #10210 we are trying to make the optimizer faster by making the different optimizer passes faster.

#10356 avoids a bunch of copies in the TypeCoercion pass

@peter-toth pointed out https://github.com/apache/datafusion/pull/10356/files#r1588892502 that this pass still does more work than necessary as it still always recomputes the schema, even when it didn't make any changes

The root cause for this is that the expression rewrite that happens via TypeCoercionRewriter doesn't return Transformed and thus we must conservatively assume that the schema needs to be recomputed

Describe the solution you'd like

  1. Change TypeCoercionRewriter to return Transformed somehow
  2. Only call LogicalPlan::recompute_schema when the expression is actually transformed

Describe alternatives you've considered

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant