Recursively searches children of [LogicalPlan] to find Unnest node if exist
(plan: &LogicalPlan)
| 74 | |
| 75 | /// Recursively searches children of [LogicalPlan] to find Unnest node if exist |
| 76 | pub(crate) fn find_unnest_node_within_select(plan: &LogicalPlan) -> Option<&Unnest> { |
| 77 | // Note that none of the nodes that have a corresponding node can have more |
| 78 | // than 1 input node. E.g. Projection / Filter always have 1 input node. |
| 79 | let input = plan.inputs(); |
| 80 | let input = if input.len() > 1 { |
| 81 | return None; |
| 82 | } else { |
| 83 | input.first()? |
| 84 | }; |
| 85 | |
| 86 | if let LogicalPlan::Unnest(unnest) = input { |
| 87 | Some(unnest) |
| 88 | } else if let LogicalPlan::TableScan(_) = input { |
| 89 | None |
| 90 | } else if let LogicalPlan::Projection(_) = input { |
| 91 | None |
| 92 | } else { |
| 93 | find_unnest_node_within_select(input) |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | /// Recursively searches children of [LogicalPlan] to find Unnest node if exist |
| 98 | /// until encountering a Relation node with single input |
no test coverage detected
searching dependent graphs…