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 dependency from LogicalPlan::TableScan to ExecutionPlan #2284

Merged
merged 10 commits into from
Apr 20, 2022

Conversation

andygrove
Copy link
Member

Which issue does this PR close?

Closes #2247

Rationale for this change

We want to remove the dependency from TableScan to ExecutionPlan so that we can move the LogicalPlan into the expr crate.

What changes are included in this PR?

  • New TableSource trait in expr crate that is referenced from TableScan
  • New DefaultTableSource struct in core crate that wraps TableProvider
  • Shim methods

Are there any user-facing changes?

Yes, at API level

@andygrove andygrove added the api change Changes the API exposed to users of the crate label Apr 20, 2022
@andygrove andygrove self-assigned this Apr 20, 2022
@github-actions github-actions bot added ballista datafusion Changes in the datafusion crate labels Apr 20, 2022
@andygrove andygrove changed the title WIP: Introduce new TableSource trait in expr crate Remove dependency from LogicalPlan::TableScan to ExecutionPlan Apr 20, 2022
@andygrove andygrove marked this pull request as ready for review April 20, 2022 13:21
@andygrove
Copy link
Member Author

@matthewmturner @alamb I aborted the large refactor and found a simpler and more practical approach. Let me know what you think.

@alamb
Copy link
Contributor

alamb commented Apr 20, 2022

I plan to review this later today

@andygrove andygrove requested a review from jimexist April 20, 2022 15:51
@alamb
Copy link
Contributor

alamb commented Apr 20, 2022

The last comment from @jimexist during "the great split of datafusion" was is #1762 (comment) -- I think this PR will help

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.

Looks good to me -- thanks @andygrove

cc @xudong963 @yjshen

datafusion/core/src/logical_plan/plan.rs Show resolved Hide resolved
}

/// Extract TableProvider from TableSource
pub fn source_as_provider(
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it is worth a comment on TableSource that it is not intended, initially, to be extended outside of DataFusion.

Temporary,
}

/// TableSource
Copy link
Contributor

Choose a reason for hiding this comment

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

It is probably worth some comments here about the rationale for this structure existing -- namely so LogicalPlan doesn't directly rely on physical plans

@andygrove
Copy link
Member Author

Thanks for the review @alamb. I pushed an update with more documentation. Let me know if I missed anything and I can address in one of the following refactor PRs.

@andygrove andygrove merged commit 817199b into apache:master Apr 20, 2022
@andygrove andygrove deleted the table-provider-refactor branch April 20, 2022 22:34
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 datafusion Changes in the datafusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LogicalPlan::TableScan should not depend on the physical plan
2 participants