in spark/sql/dataframe.go [561:585]
func (df *dataFrameImpl) CreateTempView(ctx context.Context, viewName string, replace, global bool) error {
plan := &proto.Plan{
OpType: &proto.Plan_Command{
Command: &proto.Command{
CommandType: &proto.Command_CreateDataframeView{
CreateDataframeView: &proto.CreateDataFrameViewCommand{
Input: df.relation,
Name: viewName,
Replace: replace,
IsGlobal: global,
},
},
},
},
}
responseClient, err := df.session.client.ExecutePlan(ctx, plan)
if err != nil {
return sparkerrors.WithType(fmt.Errorf("failed to create temp view %s: %w",
viewName, err), sparkerrors.ExecutionError)
}
_, _, err = responseClient.ToTable()
return err
}