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

Method sqlWith

compiler/semantic/sql.go:534–549  ·  view source on GitHub ↗
(with *ast.SQLWith)

Source from the content-addressed store, hash-verified

532}
533
534func (t *translator) sqlWith(with *ast.SQLWith) map[string]*ast.SQLCTE {
535 if with.Recursive {
536 t.error(with, errors.New("recursive WITH queries not currently supported"))
537 }
538 old := t.scope.ctes
539 t.scope.ctes = maps.Clone(t.scope.ctes)
540 for k, c := range with.CTEs {
541 // XXX Materialized option not currently supported.
542 name := strings.ToLower(c.Name.Name)
543 if _, ok := t.scope.ctes[name]; ok {
544 t.error(c.Name, errors.New("duplicate WITH clause name"))
545 }
546 t.scope.ctes[name] = &with.CTEs[k]
547 }
548 return old
549}
550
551func (t *translator) sqlCrossJoin(join *ast.SQLCrossJoin, seq sem.Seq) (sem.Seq, relScope) {
552 if len(seq) > 0 {

Callers 1

sqlQueryBodyMethod · 0.95

Calls 3

NewMethod · 0.80
CloneMethod · 0.65
errorMethod · 0.45

Tested by

no test coverage detected