diff --git a/datafusion/core/src/datasource/cte.rs b/datafusion/core/src/datasource/cte_worktable.rs similarity index 85% rename from datafusion/core/src/datasource/cte.rs rename to datafusion/core/src/datasource/cte_worktable.rs index 9fb241f49db33..e8c47eb9c22db 100644 --- a/datafusion/core/src/datasource/cte.rs +++ b/datafusion/core/src/datasource/cte_worktable.rs @@ -35,14 +35,17 @@ use datafusion_common::DataFusionError; use crate::datasource::{TableProvider, TableType}; use crate::execution::context::SessionState; -/// TODO: add docs +/// The temporary working table where the previous iteration of a recursive query is stored +/// Naming is based on PostgreSQL's implementation. +/// See here for more details: www.postgresql.org/docs/11/queries-with.html#id-1.5.6.12.5.4 pub struct CteWorkTable { name: String, + /// This schema must be shared across both the static and recursive terms of a recursive query table_schema: SchemaRef, } impl CteWorkTable { - /// TODO: add doc + /// construct a new CteWorkTable with the given name and schema pub fn new(name: &str, table_schema: SchemaRef) -> Self { Self { name: name.to_owned(), diff --git a/datafusion/core/src/datasource/mod.rs b/datafusion/core/src/datasource/mod.rs index 93f197ec9438b..8f20da183a933 100644 --- a/datafusion/core/src/datasource/mod.rs +++ b/datafusion/core/src/datasource/mod.rs @@ -20,7 +20,7 @@ //! [`ListingTable`]: crate::datasource::listing::ListingTable pub mod avro_to_arrow; -pub mod cte; +pub mod cte_worktable; pub mod default_table_source; pub mod empty; pub mod file_format; diff --git a/datafusion/core/src/execution/context/mod.rs b/datafusion/core/src/execution/context/mod.rs index 221faa3019ab3..c661e8368df5b 100644 --- a/datafusion/core/src/execution/context/mod.rs +++ b/datafusion/core/src/execution/context/mod.rs @@ -26,7 +26,7 @@ mod parquet; use crate::{ catalog::{CatalogList, MemoryCatalogList}, datasource::{ - cte::CteWorkTable, + cte_worktable::CteWorkTable, function::{TableFunction, TableFunctionImpl}, listing::{ListingOptions, ListingTable}, provider::TableProviderFactory,