-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
LogicalPlanBuilder
now uses TableSource
instead of TableProvider
#2569
Conversation
@@ -17,7 +17,6 @@ | |||
|
|||
//! This module provides a builder for creating LogicalPlans | |||
|
|||
use crate::datasource::TableProvider; |
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.
This was the main objective - removing one of the final dependencies from LogicalPlanBuilder
to the "core" datafusion
crate.
LogicalPlanBuilder
now uses TableSource
instead of TableProvider
LogicalPlanBuilder
now uses TableSource
instead of TableProvider
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.
Very nice @andygrove -- thank you!
} | ||
|
||
/// Convert a table provider into a builder with a TableScan | ||
pub fn scan_with_filters( | ||
table_name: impl Into<String>, | ||
provider: Arc<dyn TableProvider>, | ||
table_source: Arc<dyn TableSource>, |
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.
I wonder if we could make the APIs a little (avoid having to call provider_as_source
) nicer with something like
Untested:
table_source: impl Into<Arc<dyn TableSource>>
Or add some other trait that would allow us to pass both Arc<dyn TableSource>
as well as Arc<dyn TableProvider>
I think we can always refine the API in a follow on PR
Which issue does this PR close?
Closes #2346
Rationale for this change
SQL planner should use TableSource not TableProvider since there is no need to actually perform scans during planning and this would be a step towards moving the SQL planner into its own crate so we have cleaner dependency management.
What changes are included in this PR?
Use TableSource not TableProvider.
Are there any user-facing changes?
Yes, API change.