You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Add partial support for recursive queries instrumentation
This change introduces partial support for tracing and metrics instrumentation of recursive queries in DataFusion. Recursive queries now spawn a new span group for each recursive call, as the recursive implementation recreates the recursive nodes for each loop iteration. This is enabled by supporting the `with_new_inner` method on `InstrumentedExec`, which allows the optimizer to rebuild instrumented plans as needed.
However, due to current limitations in DataFusion, nodes of type `WorkTableExec` are not instrumented, as wrapping them would break recursive query execution. This limitation will be revisited once upstream changes allow `WorkTableExec` to be safely instrumented.
See also: apache/datafusion#16469 and related discussions.
// Iterate over the plan and wrap each node with InstrumentedExec
73
+
//
74
+
// NOTE: Recursive queries dynamically rebuild the execution plan during execution and assume one of the nodes is a `WorkTableExec``.
75
+
// Wrapping it with `InstrumentedExec`` would break the recursive query, so for now we only isntrument non-`WorkTableExec` nodes.
76
+
//
77
+
// TODO: Remove this limitation once `with_work_table` is made a trait method of `ExecutionPlan` (tracked by https://github.com/apache/datafusion/pull/16469)
72
78
plan.transform(|plan| {
73
-
if plan.as_any().downcast_ref::<InstrumentedExec>().is_none(){
79
+
if plan.as_any().downcast_ref::<InstrumentedExec>().is_none()
0 commit comments