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

Method maybeSubqueryCall

compiler/semantic/expr.go:870–887  ·  view source on GitHub ↗
(call *ast.CallExpr, name string, inType super.Type)

Source from the content-addressed store, hash-verified

868}
869
870func (t *translator) maybeSubqueryCall(call *ast.CallExpr, name string, inType super.Type) (*sem.SubqueryExpr, super.Type) {
871 decl, _ := t.scope.lookupOp(name)
872 if decl == nil || decl.bad {
873 return nil, nil
874 }
875 userOp, typ := t.userOp(call.Loc, decl, call.Args, inType)
876 // When a user op is encountered inside an expression, we turn it into a
877 // subquery operating on a single-shot "this" value unless it's uncorrelated
878 // (i.e., starts with a from), in which case we put the uncorrelated body
879 // in the subquery without the correlating values logic. This is controlled
880 // via the Correlated flag.
881 return &sem.SubqueryExpr{
882 Node: call,
883 Array: false,
884 Correlated: isCorrelated(userOp),
885 Body: userOp,
886 }, typ
887}
888
889func (t *translator) semMapCall(call *ast.CallExpr, args []sem.Expr, argTypes []super.Type) (sem.Expr, super.Type) {
890 if len(args) != 2 {

Callers 1

semCallByNameMethod · 0.95

Calls 3

userOpMethod · 0.95
isCorrelatedFunction · 0.85
lookupOpMethod · 0.80

Tested by

no test coverage detected