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

Remove ExecutionProps dependency from OptimizerRule #2666

Merged
merged 5 commits into from
Jun 1, 2022

Conversation

andygrove
Copy link
Member

@andygrove andygrove commented May 31, 2022

Which issue does this PR close?

Closes #2614

Rationale for this change

  • Logical optimizer rules should not depend on anything related to physical plans or execution
  • I am working on moving logical optimizer rules to their own crate so this is a step towards that

What changes are included in this PR?

  • OptimizerRule trait no longer references ExecutionProps
  • OptimizerRule trait now references OptimizerConfig instead, which contains the one value (query start time) that it was previously getting from ExecutionProps

Are there any user-facing changes?

Yes if they are using this API

Does this PR break compatibility with Ballista?

TBD

@andygrove andygrove added the api change Changes the API exposed to users of the crate label May 31, 2022
@andygrove andygrove self-assigned this May 31, 2022
@github-actions github-actions bot added core Core DataFusion crate datafusion Changes in the datafusion crate optimizer Optimizer rules labels May 31, 2022
@andygrove andygrove changed the title WIP: Remove ExecutionProps dependency from OptimizerRule Remove ExecutionProps dependency from OptimizerRule May 31, 2022
@andygrove andygrove marked this pull request as ready for review May 31, 2022 14:38
@andygrove andygrove requested a review from yjshen June 1, 2022 01:19
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -- I had only one tiny comment on the API, but that could be done later (or not at all)

Comment on lines +1379 to 1382
let mut optimizer_config = OptimizerConfig::new();
optimizer_config.query_execution_start_time =
self.execution_props.query_execution_start_time;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might look nicer with a builder style:

Suggested change
let mut optimizer_config = OptimizerConfig::new();
optimizer_config.query_execution_start_time =
self.execution_props.query_execution_start_time;
let optimizer_config = OptimizerConfig::new()
.with_query_execution_start_time(
self.execution_props.query_execution_start_time
);

@andygrove
Copy link
Member Author

Thanks @alamb. I will make that change in one of the follow on PRs.

@andygrove andygrove merged commit 9135251 into apache:master Jun 1, 2022
gandronchik pushed a commit to cube-js/arrow-datafusion that referenced this pull request Aug 30, 2022
gandronchik pushed a commit to cube-js/arrow-datafusion that referenced this pull request Aug 31, 2022
gandronchik pushed a commit to cube-js/arrow-datafusion that referenced this pull request Sep 2, 2022
@andygrove andygrove deleted the optimizer-no-execution-props branch January 27, 2023 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api change Changes the API exposed to users of the crate core Core DataFusion crate datafusion Changes in the datafusion crate optimizer Optimizer rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove ExecutionProps from OptimizerRule trait
3 participants