Skip to content

Commit 17b1418

Browse files
authored
chore(engine): move DAG logic to common package (#19406)
Signed-off-by: Robert Fratto <[email protected]>
1 parent 48f5ade commit 17b1418

File tree

12 files changed

+847
-604
lines changed

12 files changed

+847
-604
lines changed

pkg/engine/internal/planner/physical/optimizer.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func (r *removeNoopFilter) apply(node Node) bool {
2626
switch node := node.(type) {
2727
case *Filter:
2828
if len(node.Predicates) == 0 {
29-
r.plan.eliminateNode(node)
29+
r.plan.graph.Eliminate(node)
3030
changed = true
3131
}
3232
}
@@ -46,7 +46,7 @@ func (r *removeNoopMerge) apply(node Node) bool {
4646
switch node := node.(type) {
4747
case *Merge, *SortMerge:
4848
if len(r.plan.Children(node)) <= 1 {
49-
r.plan.eliminateNode(node)
49+
r.plan.graph.Eliminate(node)
5050
changed = true
5151
}
5252
}
@@ -364,7 +364,7 @@ func sortProjections(a, b ColumnExpression) int {
364364

365365
// isMetricQuery checks if the plan contains a RangeAggregation or VectorAggregation node, indicating a metric query
366366
func (r *projectionPushdown) isMetricQuery() bool {
367-
for node := range r.plan.nodes {
367+
for node := range r.plan.graph.Nodes() {
368368
if _, ok := node.(*RangeAggregation); ok {
369369
return true
370370
}

0 commit comments

Comments
 (0)