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

Function New

runtime/sam/expr/function/function.go:18–193  ·  view source on GitHub ↗
(sctx *super.Context, name string, narg int)

Source from the content-addressed store, hash-verified

16)
17
18func 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

Callers 3

semCallByNameMethod · 0.92
resolveCallMethod · 0.92
compileCallMethod · 0.92

Calls 15

NewDefuseFunction · 0.85
NewFlattenFunction · 0.85
NewNestDottedFunction · 0.85
NewParseURIFunction · 0.85
newSplitFunction · 0.85
NewUnblendFunction · 0.85
NewUnderFunction · 0.85
NewUnflattenFunction · 0.85
CheckArgCountFunction · 0.85
NewCompareFunction · 0.70
NewFieldsFunction · 0.70
newFusionFunction · 0.70

Tested by

no test coverage detected