Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
winoros committed Nov 24, 2023
1 parent 47f7681 commit 626fd5e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/planner/core/rule_column_pruning.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"bytes"
"context"
"fmt"
"slices"

"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/expression/aggregation"
Expand Down Expand Up @@ -290,7 +291,7 @@ func (p *LogicalUnionAll) PruneColumns(parentUsedCols []*expression.Column, opt
for i := len(used) - 1; i >= 0; i-- {
if !used[i] {
prunedColumns = append(prunedColumns, p.schema.Columns[i])
p.schema.Columns = append(p.schema.Columns[:i], p.schema.Columns[i+1:]...)
p.schema.Columns = slices.Delete(p.schema.Columns, i, i)
}
}
appendColumnPruneTraceStep(p, prunedColumns, opt)
Expand Down

0 comments on commit 626fd5e

Please sign in to comment.