in spark/sql/dataframe.go [408:431]
func (df *dataFrameImpl) SelectExpr(ctx context.Context, exprs ...string) (DataFrame, error) {
expressions := make([]*proto.Expression, 0, len(exprs))
for _, expr := range exprs {
col := column.NewSQLExpression(expr)
f, e := col.ToProto(ctx)
if e != nil {
return nil, e
}
expressions = append(expressions, f)
}
rel := &proto.Relation{
Common: &proto.RelationCommon{
PlanId: newPlanId(),
},
RelType: &proto.Relation_Project{
Project: &proto.Project{
Input: df.relation,
Expressions: expressions,
},
},
}
return NewDataFrame(df.session, rel), nil
}