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

Function firstThisPathComponent

compiler/optimizer/join.go:162–173  ·  view source on GitHub ↗

firstThisPathComponent returns the first component common to every dag.This.Path in e and a Boolean indicating whether such a common first component exists.

(e dag.Expr)

Source from the content-addressed store, hash-verified

160// firstThisPathComponent returns the first component common to every dag.This.Path
161// in e and a Boolean indicating whether such a common first component exists.
162func firstThisPathComponent(e dag.Expr) (prefix string, ok bool) {
163 walkT(reflect.ValueOf(e), func(t dag.ThisExpr) dag.ThisExpr {
164 if prefix == "" {
165 prefix = t.Path[0]
166 ok = true
167 } else if prefix != t.Path[0] {
168 ok = false
169 }
170 return t
171 })
172 return prefix, ok
173}
174
175// stripFirstThisPathComponent removes the first component of every dag.This.Path in e.
176func stripFirstThisPathComponent(e dag.Expr) {

Callers 2

liftFilterIntoJoinFunction · 0.85
equiJoinKeyExprsFunction · 0.85

Calls 1

walkTFunction · 0.85

Tested by

no test coverage detected