Skip to content

Commit

Permalink
wip: remove uncessary with qualifier method
Browse files Browse the repository at this point in the history
some docs

more docs
  • Loading branch information
matthewgapp committed Jan 16, 2024
1 parent 6ef0ff2 commit 8d38c92
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
5 changes: 0 additions & 5 deletions datafusion/common/src/dfschema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -909,11 +909,6 @@ impl DFField {
self.field = f.into();
self
}

pub fn with_qualifier(mut self, qualifier: impl Into<OwnedTableReference>) -> Self {
self.qualifier = Some(qualifier.into());
self
}
}

impl From<FieldRef> for DFField {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,19 @@ 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
/// This schema must match the schema of the recursive term of the query
/// Since the scan method will contain an physical plan that assumes this schema
pub fn new(name: &str, table_schema: SchemaRef) -> Self {
Self {
name: name.to_owned(),
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/src/datasource/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion datafusion/core/src/execution/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1900,6 +1900,9 @@ impl<'a> ContextProvider for SessionContextProvider<'a> {
Ok(provider_as_source(provider))
}

/// Create a new CTE work table for a recursive CTE logical plan
/// This table will be used in conjunction with a Worktable physical plan
/// to read and write each iteration of a recursive CTE
fn create_cte_work_table(
&self,
name: &str,
Expand Down

0 comments on commit 8d38c92

Please sign in to comment.