This is an automated email from the ASF dual-hosted git repository. nevime pushed a commit to branch rdbms-changes in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git
commit 724f4e3363289607fed44ce30e9a1992df55d58a Author: Wakahisa <[email protected]> AuthorDate: Mon Feb 14 22:50:05 2022 +0200 add a Tablesource Tablesource contains more information about the source of the table. It can be a relational table, file(s), in-memory or unspecified. --- datafusion/core/src/datasource/datasource.rs | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/datafusion/core/src/datasource/datasource.rs b/datafusion/core/src/datasource/datasource.rs index 1b59c857f..48a2dc09e 100644 --- a/datafusion/core/src/datasource/datasource.rs +++ b/datafusion/core/src/datasource/datasource.rs @@ -55,6 +55,35 @@ pub enum TableType { Temporary, } +/// Indicates the source of this table for metadata/catalog purposes. +#[derive(Debug, Clone, PartialEq)] +pub enum TableSource { + /// An ordinary physical table. + Relational { + /// + server: Option<String>, + /// + database: Option<String>, + /// + schema: Option<String>, + /// + table: String + }, + /// A file on some file system + File { + /// + protocol: String, + /// + path: String, + /// + format: String, + }, + /// A transient table. + InMemory, + /// An unspecified source, used as the default + Unspecified, +} + /// Source table #[async_trait] pub trait TableProvider: Sync + Send { @@ -70,6 +99,11 @@ pub trait TableProvider: Sync + Send { TableType::Base } + /// The source of this table + fn table_source(&self) -> TableSource { + TableSource::Unspecified + } + /// Create an ExecutionPlan that will scan the table. /// The table provider will be usually responsible of grouping /// the source data into partitions that can be efficiently
