File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -87,15 +87,14 @@ impl<'c> EvaluatorPlanner<'c> {
87
87
88
88
#[ inline]
89
89
fn plan_eval ( & mut self , lg : & LogicalPlan < BindingsOp > ) -> EvalPlan {
90
- let ops = lg. operators ( ) ;
91
90
let flows = lg. flows ( ) ;
92
91
93
92
let mut graph: StableGraph < _ , _ > = Default :: default ( ) ;
94
93
let mut seen = HashMap :: new ( ) ;
95
94
96
95
for ( s, d, w) in flows {
97
96
let mut add_node = |op_id : & OpId | {
98
- let logical_op = & ops [ op_id. index ( ) - 1 ] ;
97
+ let logical_op = lg . operator ( * op_id) . unwrap ( ) ;
99
98
* seen
100
99
. entry ( * op_id)
101
100
. or_insert_with ( || graph. add_node ( self . get_eval_node ( logical_op) ) )
Original file line number Diff line number Diff line change @@ -142,6 +142,11 @@ where
142
142
& self . nodes
143
143
}
144
144
145
+ /// Returns the operators of the plan with their `OpId`.
146
+ pub fn operators_by_id ( & self ) -> impl Iterator < Item = ( OpId , & T ) > {
147
+ self . nodes . iter ( ) . enumerate ( ) . map ( |( i, n) | ( OpId ( i + 1 ) , n) )
148
+ }
149
+
145
150
/// Returns the data flows of the plan.
146
151
pub fn flows ( & self ) -> & Vec < ( OpId , OpId , u8 ) > {
147
152
& self . edges
You can’t perform that action at this time.
0 commit comments