Allow table providers to indicate their type for catalog metadata #205
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #191.
Rationale for this change
This allows registered TableProviders to approximately indicate the mechanism used to retrieve data during query execution, which in turn allows tables to be logged with a
table_type
column ininformation_schema.tables
. This was previously partially supported by classifying all registered tables asBASE TABLE
and all generated system tables asVIEW
.This means that DataFusion consumers can now build systems that allow end-users to differentiate between relation types. For example, you could build a TableProvider that stores a query plan, use this as a view in your execution context, and end users would be aware that any queries over it in turn trigger a query internally. This is also often used to split relations into different lists for tables vs views in GUI/IDE setups.
What changes are included in this PR?
TableType
enumTableProvider::table_type
Are there any user-facing changes?
TableProvider::table_type
is introduced as a new trait method, but comes with a default implementation returningTableType::Base
to preserve back-compat.