MCPcopy Create free account
hub / github.com/araddon/qlbridge / BuildSqlJob

Function BuildSqlJob

exec/executor.go:46–58  ·  view source on GitHub ↗

BuildSqlJob given a plan context (query statement, +context) create a JobExecutor and error if we can't.

(ctx *plan.Context)

Source from the content-addressed store, hash-verified

44// BuildSqlJob given a plan context (query statement, +context) create
45// a JobExecutor and error if we can't.
46func 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.

Callers 11

TestExecSqlCommandsFunction · 0.92
TestExecSelectWhereFunction · 0.92
TestExecGroupByFunction · 0.92
TestExecHavingFunction · 0.92
TestExecInsertFunction · 0.92
TestExecUpdateAndUpsertFunction · 0.92
TestExecDeleteFunction · 0.92
testSubselectFunction · 0.92
ExecSpecFunction · 0.92
ExecMethod · 0.85
QueryMethod · 0.85

Calls 4

NewPlannerFunction · 0.92
NewExecutorFunction · 0.85
BuildSqlJobPlannedFunction · 0.85
ErrorfMethod · 0.80

Tested by 8

TestExecSqlCommandsFunction · 0.74
TestExecSelectWhereFunction · 0.74
TestExecGroupByFunction · 0.74
TestExecHavingFunction · 0.74
TestExecInsertFunction · 0.74
TestExecUpdateAndUpsertFunction · 0.74
TestExecDeleteFunction · 0.74
testSubselectFunction · 0.74