code: func (p *LogicalWindow) PruneColumns(parentUsedCols []*expression.Column) error {
  	windowColumn := p.GetWindowResultColumn()
  	len := 0
  	for _, col := range parentUsedCols {
  		if !windowColumn.Equal(nil, col) {
  			parentUsedCols[len] = col
  			len++
  		}
  	}
  	parentUsedCols = parentUsedCols[:len]
  	parentUsedCols = p.extractUsedCols(parentUsedCols)
  	err := p.children[0].PruneColumns(parentUsedCols)
  	if err != nil {
  		return err
  	}
  
  	p.SetSchema(p.children[0].Schema().Clone())
  	p.Schema().Append(windowColumn)
  	return nil
  }
docs: // PruneColumns implements LogicalPlan interface.