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

Method WalkSource

exec/executor.go:171–199  ·  view source on GitHub ↗
(p *plan.Source)

Source from the content-addressed store, hash-verified

169 return root, root.Add(NewDelete(m.Ctx, p))
170}
171func (m *JobExecutor) WalkSource(p *plan.Source) (Task, error) {
172 if len(p.Static) > 0 {
173 static := membtree.NewStaticData("static")
174 static.SetColumns(p.Cols)
175 _, err := static.Put(nil, nil, p.Static)
176 if err != nil {
177 u.Errorf("Could not put %v", err)
178 }
179 return NewSourceScanner(m.Ctx, p, static), nil
180 } else if p.Conn == nil {
181 u.Warnf("no conn? %T", p.DataSource)
182 if p.DataSource == nil {
183 u.Warnf("no datasource")
184 return nil, fmt.Errorf("missing data source")
185 }
186 source, err := p.DataSource.Open(p.Stmt.SourceName())
187 if err != nil {
188 return nil, err
189 }
190 p.Conn = source
191 //u.Debugf("setting p.Conn %p %T", p.Conn, p.Conn)
192 }
193
194 e, hasSourceExec := p.Conn.(ExecutorSource)
195 if hasSourceExec {
196 return e.WalkExecSource(p)
197 }
198 return NewSource(m.Ctx, p)
199}
200func (m *JobExecutor) WalkSourceExec(p *plan.Source) (Task, error) {
201
202 if p.Conn == nil {

Callers

nothing calls this directly

Calls 9

NewStaticDataFunction · 0.92
NewSourceScannerFunction · 0.85
ErrorfMethod · 0.80
NewSourceFunction · 0.70
PutMethod · 0.65
OpenMethod · 0.65
WalkExecSourceMethod · 0.65
SetColumnsMethod · 0.45
SourceNameMethod · 0.45

Tested by

no test coverage detected