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

Method apply_subqueries

datafusion/expr/src/logical_plan/tree_node.rs:826–842  ·  view source on GitHub ↗

Similarly to [`Self::apply`], calls `f` on this node and its inputs, including subqueries that may appear in expressions such as `IN (SELECT ...)`.

(
        &self,
        mut f: F,
    )

Source from the content-addressed store, hash-verified

824 /// including subqueries that may appear in expressions such as `IN (SELECT
825 /// ...)`.
826 pub fn apply_subqueries<F: FnMut(&Self) -> Result<TreeNodeRecursion>>(
827 &self,
828 mut f: F,
829 ) -> Result<TreeNodeRecursion> {
830 self.apply_expressions(|expr| {
831 expr.apply(|expr| match expr {
832 Expr::Exists(Exists { subquery, .. })
833 | Expr::InSubquery(InSubquery { subquery, .. })
834 | Expr::SetComparison(SetComparison { subquery, .. })
835 | Expr::ScalarSubquery(subquery) => {
836 // Wrap in LogicalPlan::Subquery to match f's signature
837 f(&LogicalPlan::Subquery(subquery.clone()))
838 }
839 _ => Ok(TreeNodeRecursion::Continue),
840 })
841 })
842 }
843
844 /// Similarly to [`Self::map_children`], rewrites all subqueries that may
845 /// appear in expressions such as `IN (SELECT ...)` using `f`.

Callers 2

visit_with_subqueriesMethod · 0.80

Calls 4

SubqueryClass · 0.85
apply_expressionsMethod · 0.80
applyMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected