MCPcopy Create free account
hub / github.com/apache/datafusion / try_new

Method try_new

datafusion/physical-plan/src/recursive_query.rs:83–107  ·  view source on GitHub ↗

Create a new RecursiveQueryExec

(
        name: String,
        static_term: Arc<dyn ExecutionPlan>,
        recursive_term: Arc<dyn ExecutionPlan>,
        is_distinct: bool,
    )

Source from the content-addressed store, hash-verified

81impl RecursiveQueryExec {
82 /// Create a new RecursiveQueryExec
83 pub fn try_new(
84 name: String,
85 static_term: Arc<dyn ExecutionPlan>,
86 recursive_term: Arc<dyn ExecutionPlan>,
87 is_distinct: bool,
88 ) -> Result<Self> {
89 // Each recursive query needs its own work table
90 let work_table = Arc::new(WorkTable::new(name.clone()));
91 // Use the same work table for both the WorkTableExec and the recursive term
92 let output_schema =
93 recursive_output_schema(&static_term.schema(), &recursive_term.schema());
94 let static_term = project_plan_to_schema(static_term, &output_schema)?;
95 let recursive_term = assign_work_table(recursive_term, &work_table)?;
96 let recursive_term = project_plan_to_schema(recursive_term, &output_schema)?;
97 let cache = Self::compute_properties(output_schema);
98 Ok(RecursiveQueryExec {
99 name,
100 static_term,
101 recursive_term,
102 is_distinct,
103 work_table,
104 metrics: ExecutionPlanMetricsSet::new(),
105 cache: Arc::new(cache),
106 })
107 }
108
109 /// Ref to name
110 pub fn name(&self) -> &str {

Callers

nothing calls this directly

Calls 6

newFunction · 0.85
recursive_output_schemaFunction · 0.85
project_plan_to_schemaFunction · 0.85
assign_work_tableFunction · 0.85
cloneMethod · 0.45
schemaMethod · 0.45

Tested by

no test coverage detected