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

Function isAggFunc

compiler/sfmt/ast.go:982–1000  ·  view source on GitHub ↗
(e ast.Expr)

Source from the content-addressed store, hash-verified

980}
981
982func isAggFunc(e ast.Expr) *ast.AggregateOp {
983 call, ok := e.(*ast.CallExpr)
984 if !ok {
985 return nil
986 }
987 name, ok := call.Func.(*ast.FuncNameExpr)
988 if !ok {
989 return nil
990 }
991 if _, err := agg.NewPattern(name.Name, false, true); err != nil {
992 return nil
993 }
994 return &ast.AggregateOp{
995 Kind: "AggregateOp",
996 Aggs: []ast.Assignment{{
997 RHS: call,
998 }},
999 }
1000}
1001
1002func IsBool(e ast.Expr) bool {
1003 switch e := e.(type) {

Callers 2

opMethod · 0.85
isAggAssignmentsFunction · 0.85

Calls 1

NewPatternFunction · 0.92

Tested by

no test coverage detected