Skip to content

Commit

Permalink
planner: make sure mpp join task's hashCols are all contained of its …
Browse files Browse the repository at this point in the history
…plan's schema (#52836) (#55654)

close #42587
  • Loading branch information
ti-chi-bot authored Aug 26, 2024
1 parent 3c2d1af commit e043013
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/planner/core/rule_eliminate_projection.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ func doPhysicalProjectionElimination(p PhysicalPlan) PhysicalPlan {
}
child := p.Children()[0]
if childProj, ok := child.(*PhysicalProjection); ok {
childProj.SetSchema(p.Schema())
// when current projection is an empty projection(schema pruned by column pruner), no need to reset child's schema
// TODO: avoid producing empty projection in column pruner.
if p.Schema().Len() != 0 {
childProj.SetSchema(p.Schema())
}
}
for i, col := range p.Schema().Columns {
if p.SCtx().GetSessionVars().StmtCtx.ColRefFromUpdatePlan.Has(int(col.UniqueID)) && !child.Schema().Columns[i].Equal(nil, col) {
Expand Down

0 comments on commit e043013

Please sign in to comment.