Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: compileProjection #19799

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 18 additions & 40 deletions pkg/sql/compile/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,38 @@ import (
"github.com/matrixorigin/matrixone/pkg/pb/timestamp"
"github.com/matrixorigin/matrixone/pkg/perfcounter"
"github.com/matrixorigin/matrixone/pkg/sql/colexec"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/anti"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/apply"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/connector"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/deletion"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/dispatch"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/external"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/fill"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/filter"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/group"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/indexjoin"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/intersect"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/intersectall"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/join"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/left"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/lockop"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/loopjoin"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/merge"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/mergeblock"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/mergecte"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/mergedelete"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/mergegroup"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/mergerecursive"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/minus"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/output"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/product"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/productl2"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/sample"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/semi"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/single"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/source"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/table_scan"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/value_scan"
"github.com/matrixorigin/matrixone/pkg/sql/parsers/tree"
plan2 "github.com/matrixorigin/matrixone/pkg/sql/plan"
"github.com/matrixorigin/matrixone/pkg/sql/plan/function"
Expand Down Expand Up @@ -1985,11 +1999,11 @@ func (c *Compile) compileProjection(n *plan.Node, ss []*Scope) []*Scope {
return ss
}

for i := range ss {
/* for i := range ss {
c.setProjection(n, ss[i])
}
} */

/*for i := range ss {
for i := range ss {
if ss[i].RootOp == nil {
c.setProjection(n, ss[i])
continue
Expand Down Expand Up @@ -2066,48 +2080,12 @@ func (c *Compile) compileProjection(n *plan.Node, ss []*Scope) []*Scope {
} else {
c.setProjection(n, ss[i])
}
case *loopanti.LoopAnti:
if ss[i].RootOp.(*loopanti.LoopAnti).ProjectList == nil {
ss[i].RootOp.(*loopanti.LoopAnti).ProjectList = n.ProjectList
} else {
c.setProjection(n, ss[i])
}
case *loopjoin.LoopJoin:
if ss[i].RootOp.(*loopjoin.LoopJoin).ProjectList == nil {
ss[i].RootOp.(*loopjoin.LoopJoin).ProjectList = n.ProjectList
} else {
c.setProjection(n, ss[i])
}
case *loopleft.LoopLeft:
if ss[i].RootOp.(*loopleft.LoopLeft).ProjectList == nil {
ss[i].RootOp.(*loopleft.LoopLeft).ProjectList = n.ProjectList
} else {
c.setProjection(n, ss[i])
}
case *loopmark.LoopMark:
if ss[i].RootOp.(*loopmark.LoopMark).ProjectList == nil {
ss[i].RootOp.(*loopmark.LoopMark).ProjectList = n.ProjectList
} else {
c.setProjection(n, ss[i])
}
case *loopsemi.LoopSemi:
if ss[i].RootOp.(*loopsemi.LoopSemi).ProjectList == nil {
ss[i].RootOp.(*loopsemi.LoopSemi).ProjectList = n.ProjectList
} else {
c.setProjection(n, ss[i])
}
case *loopsingle.LoopSingle:
if ss[i].RootOp.(*loopsingle.LoopSingle).ProjectList == nil {
ss[i].RootOp.(*loopsingle.LoopSingle).ProjectList = n.ProjectList
} else {
c.setProjection(n, ss[i])
}
case *mark.MarkJoin:
if ss[i].RootOp.(*mark.MarkJoin).ProjectList == nil {
ss[i].RootOp.(*mark.MarkJoin).ProjectList = n.ProjectList
} else {
c.setProjection(n, ss[i])
}
case *product.Product:
if ss[i].RootOp.(*product.Product).ProjectList == nil {
ss[i].RootOp.(*product.Product).ProjectList = n.ProjectList
Expand Down Expand Up @@ -2136,7 +2114,7 @@ func (c *Compile) compileProjection(n *plan.Node, ss []*Scope) []*Scope {
default:
c.setProjection(n, ss[i])
}
}*/
}
c.anal.isFirst = false
return ss
}
Expand Down
Loading