(sctx *super.Context, name string, narg int)
| 16 | ) |
| 17 | |
| 18 | func New(sctx *super.Context, name string, narg int) (expr.Function, error) { |
| 19 | argmin := 1 |
| 20 | argmax := 1 |
| 21 | var f expr.Function |
| 22 | switch name { |
| 23 | case "abs": |
| 24 | f = &Abs{sctx: sctx} |
| 25 | case "base64": |
| 26 | f = &Base64{sctx: sctx} |
| 27 | case "bucket": |
| 28 | argmin = 2 |
| 29 | argmax = 2 |
| 30 | f = &Bucket{sctx: sctx, name: name} |
| 31 | case "cast": |
| 32 | argmin = 2 |
| 33 | argmax = 2 |
| 34 | f = &cast{sctx} |
| 35 | case "ceil": |
| 36 | f = &Ceil{sctx: sctx} |
| 37 | case "cidr_match": |
| 38 | argmin = 2 |
| 39 | argmax = 2 |
| 40 | f = &CIDRMatch{sctx: sctx} |
| 41 | case "coalesce": |
| 42 | argmax = -1 |
| 43 | f = &Coalesce{} |
| 44 | case "compare": |
| 45 | argmin = 2 |
| 46 | argmax = 3 |
| 47 | f = NewCompare(sctx) |
| 48 | case "concat": |
| 49 | argmin = 1 |
| 50 | argmax = -1 |
| 51 | f = &Concat{sctx: sctx} |
| 52 | case "date_part": |
| 53 | argmin = 2 |
| 54 | argmax = 2 |
| 55 | f = &DatePart{sctx} |
| 56 | case "defuse": |
| 57 | f = NewDefuse(sctx) |
| 58 | case "downcast": |
| 59 | argmin = 2 |
| 60 | argmax = 2 |
| 61 | f = &downcast{sctx} |
| 62 | case "error": |
| 63 | f = &Error{sctx: sctx} |
| 64 | case "fields": |
| 65 | f = NewFields(sctx) |
| 66 | case "flatten": |
| 67 | f = NewFlatten(sctx) |
| 68 | case "floor": |
| 69 | f = &Floor{sctx: sctx} |
| 70 | case "fusion": |
| 71 | argmin = 2 |
| 72 | argmax = 2 |
| 73 | f = newFusion(sctx) |
| 74 | case "grep": |
| 75 | argmin = 2 |
no test coverage detected