BuildSqlJob given a plan context (query statement, +context) create a JobExecutor and error if we can't.
(ctx *plan.Context)
| 44 | // BuildSqlJob given a plan context (query statement, +context) create |
| 45 | // a JobExecutor and error if we can't. |
| 46 | func BuildSqlJob(ctx *plan.Context) (*JobExecutor, error) { |
| 47 | job := NewExecutor(ctx, plan.NewPlanner(ctx)) |
| 48 | task, err := BuildSqlJobPlanned(job.Planner, job.Executor, ctx) |
| 49 | if err != nil { |
| 50 | return nil, err |
| 51 | } |
| 52 | taskRunner, ok := task.(TaskRunner) |
| 53 | if !ok { |
| 54 | return nil, fmt.Errorf("Expected TaskRunner but was %T", task) |
| 55 | } |
| 56 | job.RootTask = taskRunner |
| 57 | return job, err |
| 58 | } |
| 59 | |
| 60 | // BuildSqlJobPlanned Create Job made up of sub-tasks in DAG that is the |
| 61 | // plan for execution of this query/job. |