MCPcopy Create free account
hub / github.com/brimdata/super / compileCall

Method compileCall

compiler/rungen/expr.go:249–270  ·  view source on GitHub ↗
(call *dag.CallExpr)

Source from the content-addressed store, hash-verified

247}
248
249func (b *Builder) compileCall(call *dag.CallExpr) (expr.Evaluator, error) {
250 // First check if call is to a user defined function, otherwise check for
251 // builtin function.
252 var fn expr.Function
253 if f, ok := b.funcs[call.Tag]; ok {
254 var err error
255 if fn, err = b.compileUDFCall(call.Tag, f); err != nil {
256 return nil, err
257 }
258 } else {
259 var err error
260 fn, err = function.New(b.sctx(), call.Tag, len(call.Args))
261 if err != nil {
262 return nil, fmt.Errorf("%s: %w", call.Tag, err)
263 }
264 }
265 exprs, err := b.compileExprs(call.Args)
266 if err != nil {
267 return nil, fmt.Errorf("%s: bad argument: %w", call.Tag, err)
268 }
269 return expr.NewCall(fn, exprs), nil
270}
271
272func (b *Builder) compileUDFCall(tag string, f *dag.FuncDef) (expr.Function, error) {
273 if fn, ok := b.compiledUDFs[tag]; ok { //XXX this doesn't work for stateful things

Callers 2

compileExprMethod · 0.95
compileVamCastMethod · 0.95

Implementers 15

DynamicBuildervector/builder.go
recordBuildervector/builder.go
arraySetBuildervector/builder.go
mapBuildervector/builder.go
unionBuildervector/builder.go
fusionBuildervector/builder.go
enumBuildervector/builder.go
intBuildervector/builder.go
uintBuildervector/builder.go
floatBuildervector/builder.go
boolBuildervector/builder.go
bytesStringTypeBuildervector/builder.go

Calls 5

compileUDFCallMethod · 0.95
sctxMethod · 0.95
compileExprsMethod · 0.95
NewFunction · 0.92
NewCallFunction · 0.92

Tested by

no test coverage detected