Create a new RecursiveQueryExec
(
name: String,
static_term: Arc<dyn ExecutionPlan>,
recursive_term: Arc<dyn ExecutionPlan>,
is_distinct: bool,
)
| 81 | impl 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 { |
nothing calls this directly
no test coverage detected