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

Method resolveOrdinalOuter

compiler/semantic/sql.go:699–718  ·  view source on GitHub ↗
(ts tableScope, n ast.Node, prefix string, col int)

Source from the content-addressed store, hash-verified

697}
698
699func (t *translator) resolveOrdinalOuter(ts tableScope, n ast.Node, prefix string, col int) sem.Expr {
700 switch ts := ts.(type) {
701 case *selectScope:
702 return t.resolveOrdinalOuter(ts.out, n, "out", col)
703 case *staticTable:
704 if col < 1 || col > ts.width() {
705 t.error(n, fmt.Errorf("column %d is out of range", col))
706 return badExpr
707 }
708 var path []string
709 if prefix != "" {
710 path = []string{prefix, ts.typ.Fields[col-1].Name}
711 } else {
712 path = []string{ts.typ.Fields[col-1].Name}
713 }
714 return sem.NewThis(n, path)
715 default:
716 panic(ts)
717 }
718}
719
720func dedup(scores map[string]int, s string) string {
721 cnt := scores[s]

Callers 1

sortExprMethod · 0.95

Calls 3

NewThisFunction · 0.92
widthMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected