(tag string, f *dag.FuncDef)
| 270 | } |
| 271 | |
| 272 | func (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 |
| 274 | return fn, nil |
| 275 | } |
| 276 | fn := expr.NewUDF(b.sctx(), b.funcs[tag].Name, f.Params) |
| 277 | // We store compiled UDF calls here so as to avoid stack overflows on |
| 278 | // recursive calls. |
| 279 | b.compiledUDFs[tag] = fn |
| 280 | var err error |
| 281 | if fn.Body, err = b.compileExpr(f.Expr); err != nil { |
| 282 | return nil, err |
| 283 | } |
| 284 | delete(b.compiledUDFs, tag) |
| 285 | return fn, nil |
| 286 | } |
| 287 | |
| 288 | func (b *Builder) compileMapCall(a *dag.MapCallExpr) (expr.Evaluator, error) { |
| 289 | e, err := b.compileExpr(a.Expr) |
no test coverage detected