File tree 4 files changed +12
-9
lines changed
4 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -909,11 +909,6 @@ impl DFField {
909
909
self . field = f. into ( ) ;
910
910
self
911
911
}
912
-
913
- pub fn with_qualifier ( mut self , qualifier : impl Into < OwnedTableReference > ) -> Self {
914
- self . qualifier = Some ( qualifier. into ( ) ) ;
915
- self
916
- }
917
912
}
918
913
919
914
impl From < FieldRef > for DFField {
Original file line number Diff line number Diff line change @@ -35,14 +35,19 @@ use datafusion_common::DataFusionError;
35
35
use crate :: datasource:: { TableProvider , TableType } ;
36
36
use crate :: execution:: context:: SessionState ;
37
37
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
39
41
pub struct CteWorkTable {
40
42
name : String ,
43
+ /// This schema must be shared across both the static and recursive terms of a recursive query
41
44
table_schema : SchemaRef ,
42
45
}
43
46
44
47
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
46
51
pub fn new ( name : & str , table_schema : SchemaRef ) -> Self {
47
52
Self {
48
53
name : name. to_owned ( ) ,
Original file line number Diff line number Diff line change 20
20
//! [`ListingTable`]: crate::datasource::listing::ListingTable
21
21
22
22
pub mod avro_to_arrow;
23
- pub mod cte ;
23
+ pub mod cte_worktable ;
24
24
pub mod default_table_source;
25
25
pub mod empty;
26
26
pub mod file_format;
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ mod parquet;
26
26
use crate :: {
27
27
catalog:: { CatalogList , MemoryCatalogList } ,
28
28
datasource:: {
29
- cte :: CteWorkTable ,
29
+ cte_worktable :: CteWorkTable ,
30
30
function:: { TableFunction , TableFunctionImpl } ,
31
31
listing:: { ListingOptions , ListingTable } ,
32
32
provider:: TableProviderFactory ,
@@ -1900,6 +1900,9 @@ impl<'a> ContextProvider for SessionContextProvider<'a> {
1900
1900
Ok ( provider_as_source ( provider) )
1901
1901
}
1902
1902
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
1903
1906
fn create_cte_work_table (
1904
1907
& self ,
1905
1908
name : & str ,
You can’t perform that action at this time.
0 commit comments