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

executor: Fix push downed topN won't replace correlated column problem (#53097) #53153

Merged
Merged
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
19 changes: 12 additions & 7 deletions executor/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3041,13 +3041,18 @@

func (b *executorBuilder) corColInDistPlan(plans []plannercore.PhysicalPlan) bool {
for _, p := range plans {
x, ok := p.(*plannercore.PhysicalSelection)
if !ok {
continue
}
for _, cond := range x.Conditions {
if len(expression.ExtractCorColumns(cond)) > 0 {
return true
switch x := p.(type) {
case *plannercore.PhysicalSelection:
for _, cond := range x.Conditions {
if len(expression.ExtractCorColumns(cond)) > 0 {
return true
}
}
case *plannercore.PhysicalTopN:
for _, byItem := range x.ByItems {
if len(expression.ExtractCorColumns(byItem.Expr)) > 0 {
return true
}

Check warning on line 3055 in executor/builder.go

View check run for this annotation

Codecov / codecov/patch

executor/builder.go#L3054-L3055

Added lines #L3054 - L3055 were not covered by tests
}
}
}
Expand Down
Loading