Skip to content

Commit 8d38c92

Browse files
committed
wip: remove uncessary with qualifier method
some docs more docs
1 parent 6ef0ff2 commit 8d38c92

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

datafusion/common/src/dfschema.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -909,11 +909,6 @@ impl DFField {
909909
self.field = f.into();
910910
self
911911
}
912-
913-
pub fn with_qualifier(mut self, qualifier: impl Into<OwnedTableReference>) -> Self {
914-
self.qualifier = Some(qualifier.into());
915-
self
916-
}
917912
}
918913

919914
impl From<FieldRef> for DFField {

datafusion/core/src/datasource/cte.rs renamed to datafusion/core/src/datasource/cte_worktable.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,19 @@ use datafusion_common::DataFusionError;
3535
use crate::datasource::{TableProvider, TableType};
3636
use crate::execution::context::SessionState;
3737

38-
/// TODO: add docs
38+
/// The temporary working table where the previous iteration of a recursive query is stored
39+
/// Naming is based on PostgreSQL's implementation.
40+
/// See here for more details: www.postgresql.org/docs/11/queries-with.html#id-1.5.6.12.5.4
3941
pub struct CteWorkTable {
4042
name: String,
43+
/// This schema must be shared across both the static and recursive terms of a recursive query
4144
table_schema: SchemaRef,
4245
}
4346

4447
impl CteWorkTable {
45-
/// TODO: add doc
48+
/// construct a new CteWorkTable with the given name and schema
49+
/// This schema must match the schema of the recursive term of the query
50+
/// Since the scan method will contain an physical plan that assumes this schema
4651
pub fn new(name: &str, table_schema: SchemaRef) -> Self {
4752
Self {
4853
name: name.to_owned(),

datafusion/core/src/datasource/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
//! [`ListingTable`]: crate::datasource::listing::ListingTable
2121
2222
pub mod avro_to_arrow;
23-
pub mod cte;
23+
pub mod cte_worktable;
2424
pub mod default_table_source;
2525
pub mod empty;
2626
pub mod file_format;

datafusion/core/src/execution/context/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ mod parquet;
2626
use crate::{
2727
catalog::{CatalogList, MemoryCatalogList},
2828
datasource::{
29-
cte::CteWorkTable,
29+
cte_worktable::CteWorkTable,
3030
function::{TableFunction, TableFunctionImpl},
3131
listing::{ListingOptions, ListingTable},
3232
provider::TableProviderFactory,
@@ -1900,6 +1900,9 @@ impl<'a> ContextProvider for SessionContextProvider<'a> {
19001900
Ok(provider_as_source(provider))
19011901
}
19021902

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

0 commit comments

Comments
 (0)