Uh oh!
There was an error while loading. Please reload this page.
Allow table providers to indicate their type for catalog metadata - #205
Conversation
codecov-commenter
commented
Apr 26, 2021
Codecov Report
@@ Coverage Diff @@## master #205 +/- ##
==========================================
- Coverage 76.35% 76.33% -0.02%
==========================================
Files 134 134 Lines 23018 23042 +24 ==========================================
+ Hits 17576 17590 +14 - Misses 5442 5452 +10
Continue to review full report at Codecov.
|
alamb
left a comment
There was a problem hiding this comment.
looks great to me. Thanks @returnString
I plan to leave this open for a bit to see if anyone else has comments, but I think it is ready to go
| /// An ordinary physical table. | ||
| Base, | ||
| /// A non-materialised table that itself uses a query internally to provide data. | ||
| View, |
There was a problem hiding this comment.
A preview of things to come, perhaps :)
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_typecolumn ininformation_schema.tables. This was previously partially supported by classifying all registered tables asBASE TABLEand 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?
TableTypeenumTableProvider::table_typeAre there any user-facing changes?
TableProvider::table_typeis introduced as a new trait method, but comes with a default implementation returningTableType::Baseto preserve back-compat.