code: func (b *PlanBuilder) resolveGeneratedColumns(columns []*table.Column, onDups map[string]struct{}, mockPlan LogicalPlan) (igc InsertGeneratedColumns, err error) {
  	for _, column := range columns {
  		if !column.IsGenerated() {
  			continue
  		}
  		columnName := &ast.ColumnName{Name: column.Name}
  		columnName.SetText(column.Name.O)
  
  		colExpr, _, err := mockPlan.findColumn(columnName)
  		if err != nil {
  			return igc, err
  		}
  
  		expr, _, err := b.rewrite(column.GeneratedExpr, mockPlan, nil, true)
  		if err != nil {
  			return igc, err
  		}
  		expr = expression.BuildCastFunction(b.ctx, expr, colExpr.GetType())
  
  		igc.Columns = append(igc.Columns, columnName)
  		igc.Exprs = append(igc.Exprs, expr)
  		if onDups == nil {
  			continue
  		}
  		for dep := range column.Dependences {
  			if _, ok := onDups[dep]; ok {
  				assign := &expression.Assignment{Col: colExpr, Expr: expr}
  				igc.OnDuplicates = append(igc.OnDuplicates, assign)
  				break
  			}
  		}
  	}
  	return igc, nil
  }
docs: // resolveGeneratedColumns resolves generated columns with their generation
  // expressions respectively. onDups indicates which columns are in on-duplicate list.